diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index 2d3159c..69efb83 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -551,7 +551,7 @@ class Select extends Query implements SelectInterface {
   }
 
   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..391bf6b 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
