diff --git a/src/Task/TaskManager.php b/src/Task/TaskManager.php
index ce455a6..89a4f28 100644
--- a/src/Task/TaskManager.php
+++ b/src/Task/TaskManager.php
@@ -91,15 +91,16 @@ protected function getTaskStorage() {
    *   property names keyed to the value (or values, for multiple possibilities)
    *   that the property should have.
    *
-   * @return \Drupal\Core\Entity\Query\QueryInterface
+   * @return \Drupal\Core\Database\Query\SelectInterface
    *   An entity query for search tasks.
    */
   protected function getTasksQuery(array $conditions = array()) {
-    $query = $this->getTaskStorage()->getQuery();
+    $query = \Drupal::database()->select('search_api_task', 't')
+      ->fields('t', array('id'));
     foreach ($conditions as $property => $values) {
       $query->condition($property, (array) $values, 'IN');
     }
-    $query->sort('id');
+    $query->orderBy('id');
     return $query;
   }
 
@@ -107,7 +108,7 @@ protected function getTasksQuery(array $conditions = array()) {
    * {@inheritdoc}
    */
   public function getTasksCount(array $conditions = array()) {
-    return $this->getTasksQuery($conditions)->count()->execute();
+    return $this->getTasksQuery($conditions)->countQuery()->execute()->fetchField();
   }
 
   /**
@@ -128,7 +129,7 @@ public function addTask($type, ServerInterface $server = NULL, IndexInterface $i
    * {@inheritdoc}
    */
   public function loadTasks(array $conditions = array()) {
-    $task_ids = $this->getTasksQuery($conditions)->execute();
+    $task_ids = $this->getTasksQuery($conditions)->execute()->fetchCol();
     if ($task_ids) {
       return $this->getTaskStorage()->loadMultiple($task_ids);
     }
@@ -153,7 +154,8 @@ public function deleteTasks(array $conditions = array()) {
     while (TRUE) {
       $task_ids = $this->getTasksQuery($conditions)
         ->range(0, 100)
-        ->execute();
+        ->execute()
+        ->fetchCol();
       if (!$task_ids) {
         break;
       }
@@ -186,7 +188,7 @@ public function executeSpecificTask(TaskInterface $task) {
    * {@inheritdoc}
    */
   public function executeSingleTask(array $conditions = array()) {
-    $task_id = $this->getTasksQuery($conditions)->range(0, 1)->execute();
+    $task_id = $this->getTasksQuery($conditions)->range(0, 1)->execute()->fetchCol();
     if ($task_id) {
       $task_id = reset($task_id);
       /** @var \Drupal\search_api\Task\TaskInterface $task */
@@ -210,7 +212,7 @@ public function executeAllTasks(array $conditions = array(), $limit = NULL) {
       if (isset($limit)) {
         $query->range(0, $limit - $executed);
       }
-      $task_ids = $query->execute();
+      $task_ids = $query->execute()->fetchCol();
 
       if (!$task_ids) {
         break;
@@ -242,7 +244,7 @@ public function executeAllTasks(array $conditions = array(), $limit = NULL) {
    * {@inheritdoc}
    */
   public function setTasksBatch(array $conditions = array()) {
-    $task_ids = $this->getTasksQuery($conditions)->range(0, 100)->execute();
+    $task_ids = $this->getTasksQuery($conditions)->range(0, 100)->execute()->fetchCol();
 
     if (!$task_ids) {
       return;
@@ -291,7 +293,8 @@ public function processBatch(array $task_ids, array $conditions, array &$context
     if (!$context['sandbox']['task_ids']) {
       $context['sandbox']['task_ids'] = $this->getTasksQuery($conditions)
         ->range(0, 100)
-        ->execute();
+        ->execute()
+        ->fetchCol();
       if (!$context['sandbox']['task_ids']) {
         $context['finished'] = 1;
         return;
