      FreeGenerator(generator);
  
      return NULL;
-@@ -2286,6 +2290,8 @@ char* TRI_GenerateCodeAql (TRI_aql_context_t* const context) {
-     TRI_AQL_DUMP("generated code: %s\n", code);
+@@ -2283,9 +2287,11 @@ char* TRI_GenerateCodeAql (TRI_aql_context_t* const context) {
+   FreeGenerator(generator);
+ 
+   if (code) {
+-    TRI_AQL_DUMP("generated code: %s\n", code);
++    TRI_AQL_LOG("generated code: %s\n", code);
    }
  
 +  TRI_AQL_LOG("generating code successful");

 /// @brief V8 startup loader
 ////////////////////////////////////////////////////////////////////////////////
 
diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp
index 9bd6923..8b7aad7 100755
--- a/arangod/V8Server/v8-vocbase.cpp

 
   return true;
 }
diff --git a/arangod/Ahuacatl/ahuacatl-log.h b/arangod/Ahuacatl/ahuacatl-log.h
index f8e92b7..aa5cf5e 100644
--- a/arangod/Ahuacatl/ahuacatl-log.h
+++ b/arangod/Ahuacatl/ahuacatl-log.h
@@ -35,7 +35,7 @@ extern "C" {
 #endif
 
 #undef TRI_DEBUG_AQL  
-//#define TRI_DEBUG_AQL 1
+#define TRI_DEBUG_AQL 1
 
 // -----------------------------------------------------------------------------
 // --SECTION--                                                     public macros
@@ -52,10 +52,8 @@ extern "C" {
 
 #ifdef TRI_DEBUG_AQL
 #define TRI_AQL_LOG(...) LOG_INFO(__VA_ARGS__);
-#define TRI_AQL_DUMP(format, ...) printf(format, __VA_ARGS__);
 #else
 #define TRI_AQL_LOG(...) LOG_TRACE(__VA_ARGS__);
-#define TRI_AQL_DUMP(...) { };
 #endif
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/arangod/Ahuacatl/ahuacatl-optimiser.c b/arangod/Ahuacatl/ahuacatl-optimiser.c
index 49437aa..43d905b 100644
--- a/arangod/Ahuacatl/ahuacatl-optimiser.c
