Index: trunk/zoo-project/zoo-kernel/caching.c
===================================================================
--- trunk/zoo-project/zoo-kernel/caching.c	(revision 960)
+++ trunk/zoo-project/zoo-kernel/caching.c	(revision 961)
@@ -403,5 +403,5 @@
   if(strncasecmp(request,"file://",7)==0){
     char* tmpStr=zStrdup(request+7);
-    fprintf(stderr,"**** %s %d %s \n",__FILE__,__LINE__,tmpStr);
+    setMapInMaps(conf,"lenv",tmpStr,"local");
     return tmpStr;
   }
@@ -709,30 +709,33 @@
       unlockFile(*m,lck);
     }
-    cached[strlen(cached)-1]='m';
-    s=zStat(cached, &f_status);
-    if(s==0){
-      zooLock* lck=lockFile(*m,cached,'r');
-      if(lck==NULL)
-	return -1;
-      mimeType=(char*)malloc(sizeof(char)*(f_status.st_size+1));
-      FILE* f=fopen(cached,"rb");
-      fread(mimeType,f_status.st_size,1,f);
-      mimeType[f_status.st_size]=0;
-      fclose(f);
-      unlockFile(*m,lck);
-    }
-    cached[strlen(cached)-1]='p';
-    s=zStat(cached, &f_status);
-    if(s==0){
-      zooLock* lck=lockFile(*m,cached,'r');
-      if(lck==NULL)
-	return -1;
-      origin=(char*)malloc(sizeof(char)*(f_status.st_size+1));
-      FILE* f=fopen(cached,"rb");
-      fread(origin,f_status.st_size,1,f);
-      mimeType[f_status.st_size]=0;
-      fclose(f);
-      unlockFile(*m,lck);
-    }
+    map* isLocalFile=getMapFromMaps(*m,"lenv",cached);
+    if(isLocalFile==NULL){
+      cached[strlen(cached)-1]='m';
+      s=zStat(cached, &f_status);
+      if(s==0){
+	zooLock* lck=lockFile(*m,cached,'r');
+	if(lck==NULL)
+	  return -1;
+	mimeType=(char*)malloc(sizeof(char)*(f_status.st_size+1));
+	FILE* f=fopen(cached,"rb");
+	fread(mimeType,f_status.st_size,1,f);
+	mimeType[f_status.st_size]=0;
+	fclose(f);
+	unlockFile(*m,lck);
+      }
+      cached[strlen(cached)-1]='p';
+      s=zStat(cached, &f_status);
+      if(s==0){
+	zooLock* lck=lockFile(*m,cached,'r');
+	if(lck==NULL)
+	  return -1;
+	origin=(char*)malloc(sizeof(char)*(f_status.st_size+1));
+	FILE* f=fopen(cached,"rb");
+	fread(origin,f_status.st_size,1,f);
+	mimeType[f_status.st_size]=0;
+	fclose(f);
+	unlockFile(*m,lck);
+      }
+    }    
   }else{    
     addRequestToQueue(m,hInternet,url,true);
Index: trunk/zoo-project/zoo-kernel/main_conf_read.y
===================================================================
--- trunk/zoo-project/zoo-kernel/main_conf_read.y	(revision 960)
+++ trunk/zoo-project/zoo-kernel/main_conf_read.y	(revision 961)
@@ -162,4 +162,6 @@
     freeMap(&current_content);
     free(current_content);
+  }else{
+    current_maps->next=NULL;
   }
   if(curr_key!=NULL){
Index: trunk/zoo-project/zoo-kernel/server_internal.c
===================================================================
--- trunk/zoo-project/zoo-kernel/server_internal.c	(revision 960)
+++ trunk/zoo-project/zoo-kernel/server_internal.c	(revision 961)
@@ -373,9 +373,7 @@
     return ;
   }
-  fseek(file, 0, SEEK_END);
   zStatStruct f_status;
   int s=zStat(filename, &f_status);
   sprintf(rsize,"%lld",f_status.st_size);
-  rewind(file);
   if(getMap(content,"storage")==NULL){
     map* memUse=getMapFromMaps(m,"main","memory");
@@ -390,4 +388,5 @@
       if(tmpMap1->value==NULL){
 	setMapInMaps(m,"lenv","message","Unable to allocate the memory required to read the produced file.");
+	return;
       }
       fread(&tmpMap1->value,1,f_status.st_size,file);
@@ -395,6 +394,7 @@
     }
   }
-  fclose(file);  
-  addToMap(content,"size",rsize);
+  fclose(file);
+  if(content!=NULL)
+    addToMap(content,"size",rsize);
 }
 
Index: trunk/zoo-project/zoo-kernel/service.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service.c	(revision 960)
+++ trunk/zoo-project/zoo-kernel/service.c	(revision 961)
@@ -328,9 +328,12 @@
     fprintf(stderr,"freeMap\n");
 #endif
-    free(_cursor->name);
-    free(_cursor->value);
+    if(_cursor->name!=NULL)
+      free(_cursor->name);
+    if(_cursor->value!=NULL)
+      free(_cursor->value);
     if(_cursor->next!=NULL){
       freeMap(&_cursor->next);
-      free(_cursor->next);
+      if(_cursor->next!=NULL)
+	free(_cursor->next);
     }
   }
@@ -825,7 +828,7 @@
     else{
       maps* tmp1=getMaps(*mo,tmp->name);
-      while(_cursor->next!=NULL)
-	_cursor=_cursor->next;
       if(tmp1==NULL){
+	while(_cursor->next!=NULL)
+	  _cursor=_cursor->next;
 	_cursor->next=dupMaps(&tmp);
 	if(tmp->child!=NULL)
Index: trunk/zoo-project/zoo-kernel/service_internal_python.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_python.c	(revision 960)
+++ trunk/zoo-project/zoo-kernel/service_internal_python.c	(revision 961)
@@ -468,5 +468,5 @@
   while(tmp!=NULL){
     PyObject* name=PyString_FromString(tmp->name);
-    if(strcasecmp(tmp->name,"value")==0) {
+    if(strcasecmp(tmp->name,"value")==0 && strlen(tmp->value)>0) {
       if(isArray!=NULL){
 	map* len=getMap(tmp,"length");
