Index: trunk/zoo-project/zoo-kernel/zoo_loader.c
===================================================================
--- trunk/zoo-project/zoo-kernel/zoo_loader.c	(revision 379)
+++ trunk/zoo-project/zoo-kernel/zoo_loader.c	(revision 380)
@@ -78,4 +78,6 @@
   fprintf (stderr, "RequestMethod: (%s) %d %d\n", cgiRequestMethod,strncasecmp(cgiRequestMethod,"post",4),strncmp(cgiContentType,"text/xml",8)==0 || strncasecmp(cgiRequestMethod,"post",4)==0); 
   fprintf (stderr, "Request: %s\n", cgiQueryString);
+  fprintf (stderr, "ContentType: %s\n", cgiContentType);
+  fprintf (stderr, "ContentLength: %d\n", cgiContentLength);
   fflush(stderr);
 #endif
@@ -112,5 +114,6 @@
     }else{
       char *buffer=new char[cgiContentLength+1];
-      if(fread(buffer,sizeof(char),cgiContentLength,cgiIn)){
+      int r=0;
+      if((r=fread(buffer,sizeof(char),cgiContentLength,cgiIn))!=0){
 	buffer[cgiContentLength]=0;
 	tmpMap=createMap("request",buffer);
@@ -209,5 +212,4 @@
 	      addToMap(tmpMap,"xrequest",(char*)xmlbuff);
 	      char *tmp=(char*)xmlbuff;
-	      fprintf(stderr,"%s\n",tmp);
 	      xmlFree(xmlbuff);
 	    }
Index: trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 379)
+++ trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 380)
@@ -1805,6 +1805,9 @@
 		  tmpmaps->next=NULL;
 		}
-		else
+		else{
+		  if(tmpmaps->name!=NULL)
+		    free(tmpmaps->name);
 		  tmpmaps->name=strdup((char*)val);;
+		}
 		xmlFree(val);
 	      }
@@ -1835,19 +1838,23 @@
 		xmlFree(val);
 	      }
+	      if(request_output_real_format==NULL)
+		request_output_real_format=dupMaps(&tmpmaps);
+	      else
+		addMapsToMaps(&request_output_real_format,tmpmaps);
 	      cur2=cur2->next;
+	      while(cur2!=NULL && cur2->type != XML_ELEMENT_NODE)
+		cur2=cur2->next;
 	    }
 	  }
 	  cur1=cur1->next;
+	  while(cur1!=NULL && cur1->type != XML_ELEMENT_NODE)
+	    cur1=cur1->next;
 	}
       }
-      if(request_output_real_format==NULL)
-	request_output_real_format=dupMaps(&tmpmaps);
-      else
-	addMapsToMaps(&request_output_real_format,tmpmaps);
-#ifdef DEBUG
-      dumpMaps(tmpmaps);
-#endif
-      freeMaps(&tmpmaps);
-      free(tmpmaps);
+      if(tmpmaps!=NULL){
+	freeMaps(&tmpmaps);
+	free(tmpmaps);
+	tmpmaps=NULL;
+      }
     }
 
