diff --git a/FeedsXPathParserBase.inc b/FeedsXPathParserBase.inc
index 09b77f5..c5fc62f 100644
--- a/FeedsXPathParserBase.inc
+++ b/FeedsXPathParserBase.inc
@@ -68,7 +68,7 @@ abstract class FeedsXPathParserBase extends FeedsParser {
 
     $context_query = '(' . $source_config['context'] . ')';
     if (empty($state->total)) {
-      $state->total = $this->xpath->namespacedQuery('count(' . $context_query . ')', $this->doc, 'count');
+      $state->total = $this->xpath->namespacedQuery('count(' . $context_query . ')', NULL, 'count');
     }
 
     $start = $state->pointer ? $state->pointer : 0;
diff --git a/FeedsXPathParserDOMXPath.inc b/FeedsXPathParserDOMXPath.inc
index 8f569c9..5406eca 100644
--- a/FeedsXPathParserDOMXPath.inc
+++ b/FeedsXPathParserDOMXPath.inc
@@ -164,12 +164,7 @@ class FeedsXPathParserDOMXPath extends DOMXPath {
     // Perfom XPath query.
     // So, grrr. FALSE is returned when there is an error. However, FALSE is
     // also a valid return value from DOMXPath::evaluate(). Ex: '1 = 2'
-    if ($context) {
-      $results = $this->evaluate($query, $context);
-    }
-    else {
-      $results = $this->query($query);
-    }
+    $results = $this->evaluate($query, $context);
 
     $this->error = libxml_get_last_error();
     libxml_clear_errors();
