diff --git a/includes/jcarousel.views.inc b/includes/jcarousel.views.inc
index 68a090b..b1cc3e9 100644
--- a/includes/jcarousel.views.inc
+++ b/includes/jcarousel.views.inc
@@ -143,15 +143,17 @@ function jcarousel_views_add($view, $display_id = NULL) {
   }
 
   // Get the total number of items in this view.
-  $count_query = $view->build_info['count_query']->countQuery();
-  $count = $count_query->execute()->fetchField();
+  if ($view->build_info['count_query']) {
+    $count_query = $view->build_info['count_query']->countQuery();
+    $count = $count_query->execute()->fetchField();
 
-  // Views may already populate total_rows later, but since we've already
-  // generated this value, we might as well make it available.
-  $view->total_rows = $count;
+    // Views may already populate total_rows later, but since we've already
+    // generated this value, we might as well make it available.
+    $view->total_rows = $count;
+  }
 
   // If there is just one item disable the auto-scroll and rotation.
-  if ($count == 1) {
+  if ($view->total_rows == 1) {
     $options['wrap'] = NULL;
     $options['auto'] = 0;
   }
@@ -165,7 +167,7 @@ function jcarousel_views_add($view, $display_id = NULL) {
   // If using AJAX, adjust the view's positioning based on the current page.
   if ($use_ajax) {
     $options['ajax'] = TRUE;
-    $options['size'] = $count;
+    $options['size'] = $view->total_rows;
 
     // Views 2:
     if (isset($view->pager)) {
