  
    if (tryCatch.HasCaught()) {
      if (tryCatch.Exception()->IsObject() && v8::Handle<v8::Array>::Cast(tryCatch.Exception())->HasOwnProperty(v8::String::New("errorNum"))) {
-@@ -1906,17 +2019,16 @@ static v8::Handle<v8::Value> JS_ParseAhuacatl (v8::Arguments const& argv) {
+@@ -1906,18 +1999,16 @@ static v8::Handle<v8::Value> JS_ParseAhuacatl (v8::Arguments const& argv) {
    }
    string queryString = TRI_ObjectToString(queryArg);
  

   }
   catch (err) {
     actions.resultException(req, res, err);
diff --git a/js/common/modules/simple-query-basics.js b/js/common/modules/simple-query-basics.js
index 0840c2c..ed5daa1 100644
--- a/js/common/modules/simple-query-basics.js
+++ b/js/common/modules/simple-query-basics.js
@@ -150,6 +150,7 @@ GeneralArrayCursor.prototype._PRINT = function () {
 ////////////////////////////////////////////////////////////////////////////////
 
 GeneralArrayCursor.prototype.hasNext = function () {
+  require("console").log("hasNext called. current: " + this._current + ", stop: " + this._stop);
   return this._current < this._stop;
 }
 
@@ -176,7 +177,8 @@ GeneralArrayCursor.prototype.dispose = function() {
   this._limit = null;
   this._countTotal = null;
   this._countQuery = null;
-  this.current = null;
+  this._current = null;
+  this._stop = null;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -663,7 +665,9 @@ SimpleQueryArray.prototype.execute = function () {
       this._skip = 0;
     }
 
+    require("console").log("creating GeneralArrayCursor with " + this._documents.length + " docs, skip: " + this._skip + ", limit: " + this._limit);
     this._execution = new GeneralArrayCursor(this._documents, this._skip, this._limit);
+    require("console").log("created GeneralArrayCursor");
   }
 }
 
diff --git a/js/server/ahuacatl.js b/js/server/ahuacatl.js
index 665f723..1707ab4 100644
--- a/js/server/ahuacatl.js
+++ b/js/server/ahuacatl.js
@@ -385,7 +385,11 @@ function AHUACATL_LIST (value) {
 ////////////////////////////////////////////////////////////////////////////////
 
 function AHUACATL_GET_DOCUMENTS (collection) {
-  return internal.db[collection].all().toArray();
+  require("console").log("AHUACATL_GET_DOCUMENTS called for " + collection);
+  var result = internal.db[collection].ALL(0, null).documents;
+  require("console").log("AHUACATL_GET_DOCUMENTS finished for " + collection);
+
+  return result;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/js/server/js-ahuacatl.h b/js/server/js-ahuacatl.h
index 7bf2dd5..7ab98bc 100644
--- a/js/server/js-ahuacatl.h
+++ b/js/server/js-ahuacatl.h
@@ -386,7 +386,11 @@ static string JS_server_ahuacatl =
   "////////////////////////////////////////////////////////////////////////////////\n"
   "\n"
   "function AHUACATL_GET_DOCUMENTS (collection) {\n"
-  "  return internal.db[collection].all().toArray();\n"
+  "  require(\"console\").log(\"AHUACATL_GET_DOCUMENTS called for \" + collection);\n"
+  "  var result = internal.db[collection].ALL(0, null).documents;\n"
+  "  require(\"console\").log(\"AHUACATL_GET_DOCUMENTS finished for \" + collection);\n"
+  "\n"
+  "  return result;\n"
   "}\n"
   "\n"
   "////////////////////////////////////////////////////////////////////////////////\n"
diff --git a/lib/Basics/ConditionLocker.cpp b/lib/Basics/ConditionLocker.cpp
index e9469e6..097ef7b 100644
--- a/lib/Basics/ConditionLocker.cpp

 /// @brief broadcasts an event
 ////////////////////////////////////////////////////////////////////////////////
 
