diff --git a/classes/Utils.php b/classes/Utils.php
index ca462487e5a1ebce38274553c942c0952c8c1587..32021fde807c39dba5185e58e875a38669a6f557 100644
--- a/classes/Utils.php
+++ b/classes/Utils.php
@@ -432,7 +432,7 @@ class Utils{
   	  if($conf['debug']){
   	  	echo "\n-------------------------------------------------\nIn ".getcwd()."\n";
   	    echo "$modelFile (against ".$e->getSparqlUrl().")\n";
-  	  	echo $query;
+  	  	echo $query."\n";
   	  }
   	  trigger_error("Running query from ".$modelFile." on endpoint ".$e->getSparqlURL(), E_USER_NOTICE);
   	  $initTime = microtime(true);
@@ -441,6 +441,12 @@ class Utils{
   	  if($conf['debug']){
   	    echo "Execution time: ".($endTime - $initTime)." seconds\n-------------------------------------------------\n\n";
   	  }
+  	  $timeObj = new stdClass();
+  	  $timeObj->query = new stdClass();
+  	  $timeObj->query->value = $modelFile;
+  	  $timeObj->time = new stdClass();
+  	  $timeObj->time->value = ($endTime - $initTime);
+  	  $lodspk['queryTimes'][$modelFile] = $timeObj;
   	  if($modelFile != $lodspk['type']){
   	  	if(!isset($rPointer[$strippedModelFile])){
   	  	  $rPointer[$strippedModelFile] = array();
@@ -537,6 +543,7 @@ class Utils{
   	if(isset($lodspkData['params'])){
   	  $lodspk['this']['params'] = $lodspkData['params'];
   	}
+  	$lodspk['queryTimes'] = Convert::array_to_object($lodspk['queryTimes']);
   	require_once($conf['home'].'lib/Haanga/lib/Haanga.php');
   	$viewAux = explode("/",$view);
   	$viewFile = array_pop($viewAux);
diff --git a/classes/modules/serviceModule.php b/classes/modules/serviceModule.php
index adbf2f194c515b684a4f17798c78c194d08ad024..e7630b415b22179e7c908bf29294790763e3c314 100644
--- a/classes/modules/serviceModule.php
+++ b/classes/modules/serviceModule.php
@@ -144,11 +144,10 @@ class ServiceModule extends abstractModule{
       	$lodspk['firstResults'] = Convert::array_to_object($firstAux);
       }else{
       	$resultsObj = $results;
-      }
-  	  
+      }  	  
   	  //Need to redefine viewFile as 'local' i.e., inside service.foo/ so I can load files with the relative path correctly
   	  //$viewFile = $extension.".template";
-  	  //chdir($conf['home']);  	  
+  	  //chdir($conf['home']); 
   	  Utils::processDocument($viewFile, $lodspk, $results);    	  
   	}catch (Exception $ex){
   	  echo $ex->getMessage();