diff --git a/smart_paging.module b/smart_paging.module
index 4927d7b..80f97c4 100644
--- a/smart_paging.module
+++ b/smart_paging.module
@@ -5,7 +5,7 @@
  * @file
  * Provides smart paging capability to Drupal contents.
  *
- * @author Roland Michael dela Peña.
+ * @author Roland Michael dela PeÃ±a.
  * @version $Id: smart_paging.module,v 1.1.2.10 2011/02/22 15:29:51 arpeggio Exp $
  */
 
@@ -504,9 +504,11 @@ function smart_paging_url_outbound_alter(&$path, &$options, $original_path) {
   if (isset($options['query']['page'])) {
     $url_fragment = smart_paging_get_url_fragment();
     $page_query = explode(',', $options['query']['page']);
-    foreach ($url_fragment as $index => $fragment) {
-      if ($page_query[1] == $index) {
-        $options['fragment'] = $fragment;
+    if (!empty($url_fragment) && is_array($url_fragment)) {
+      foreach ($url_fragment as $index => $fragment) {
+        if ($page_query[1] == $index) {
+          $options['fragment'] = $fragment;
+        }
       }
     }
     if (!empty($path) && !$options['alias']) {
