diff --git a/core/includes/database/select.inc b/core/includes/database/select.inc
index 9bc6b92..d7568bf 100644
--- a/core/includes/database/select.inc
+++ b/core/includes/database/select.inc
@@ -1391,7 +1391,7 @@ class SelectQuery extends Query implements SelectQueryInterface {
   }
 
   public function range($start = NULL, $length = NULL) {
-    $this->range = func_num_args() ? array('start' => $start, 'length' => $length) : array();
+    $this->range = isset($length) ? array('start' => $start, 'length' => $length) : array();
     return $this;
   }
 
diff --git a/core/modules/entity/tests/entity_query.test b/core/modules/entity/tests/entity_query.test
index 29642bc..67c2359 100644
--- a/core/modules/entity/tests/entity_query.test
+++ b/core/modules/entity/tests/entity_query.test
@@ -1130,6 +1130,20 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       array('test_entity', 1),
     ), t('Test with a language meta condition.'));
 
+    // Test range removal
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity_bundle_key')
+      ->entityCondition('bundle', 'bundle1')
+      ->range(0, 1)
+      ->range()
+    $this->assertEntityFieldQuery($query, array(
+      array('test_entity_bundle_key', 1),
+      array('test_entity_bundle_key', 2),
+      array('test_entity_bundle_key', 3),
+      array('test_entity_bundle_key', 4),
+    ), t('Test entity bundle condition: bundle1.'));
+
     // Test delta grouping.
     $query = new EntityFieldQuery();
     $query
