Index: orxonox/trunk/src/lib/graphics/importer/model.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 4037)
+++ orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 4038)
@@ -35,5 +35,7 @@
 */
 ModelFaceElement::ModelFaceElement()
-{}
+{
+  this->next = NULL;
+}
 
 /**
@@ -42,40 +44,35 @@
 ModelFaceElement::~ModelFaceElement()
 {
+  if (this->next)
+    delete this->next;
+}
+
+/**
+   \brief creates a new ModelFace
+*/
+ModelFace::ModelFace()
+{
+  this->vertexCount = 0;
+
+  this->firstElem = NULL;
+  
+  this->material = NULL;
+  
+  this->next = NULL;
+
+}
+
+/**
+   \brief deletes a ModelFace
+*/
+ModelFace::~ModelFace()
+{
+  PRINTF(5)("Cleaning up Face\n");
+
+  if (this->firstElem != NULL)
+    delete this->firstElem;
+  
   if (this->next != NULL)
     delete this->next;
-}
-
-/**
-   \brief creates a new ModelFace
-*/
-ModelFace::ModelFace()
-{
-  this->vertexCount = 0;
-
-  this->firstElem = NULL;
-  
-  this->material = NULL;
-  
-  this->next = NULL;
-
-}
-
-/**
-   \brief deletes a ModelFace
-*/
-ModelFace::~ModelFace()
-{
-  PRINTF(5)("Cleaning up Face\n");
-
-  if (this->firstElem != NULL)
-    {
-      delete this->firstElem;
-    }
-      
-  if (this->next != NULL)
-    {
-      delete this->next;
-    }
-
 }
 
@@ -102,7 +99,5 @@
   PRINTF(5)("Cleaning up group\n");
   if (this->firstFace != NULL)
-    {
-      delete this->firstFace;
-    }
+    delete this->firstFace;
 
   if (this->next !=NULL)
@@ -175,12 +170,5 @@
 
   PRINTF(5)("Deleting display Lists.\n");
-  ModelGroup* walker = this->firstGroup;
-  while (walker != NULL)
-    {
-      glDeleteLists (walker->listNumber, 1);
-      ModelGroup* delWalker = walker;
-      walker = walker->next;
-      delete delWalker;
-    }
+  delete this->firstGroup;
 
   // deleting Arrays
@@ -191,4 +179,6 @@
   tIterator<Material>* tmpIt = this->materialList->getIterator();
   Material* material = tmpIt->nextElement();
+
+  //! \todo do we really have to delete this material??
   while(material)
     {
@@ -227,10 +217,10 @@
 {
   PRINTF(4)("drawing the 3D-Models\n"); 
-  ModelGroup* walker = this->firstGroup;
-  while (walker != NULL)
-    {
-      PRINTF(5)("Drawing model %s\n", walker->name);
-      glCallList (walker->listNumber);
-      walker = walker->next;
+  ModelGroup* tmpGroup = this->firstGroup;
+  while (tmpGroup != NULL)
+    {
+      PRINTF(5)("Drawing model %s\n", tmpGroup->name);
+      glCallList (tmpGroup->listNumber);
+      tmpGroup = tmpGroup->next;
     }
 }
@@ -250,16 +240,16 @@
     }
   PRINTF(4)("drawing the requested 3D-Models if found.\n"); 
-  ModelGroup* walker = this->firstGroup;
+  ModelGroup* tmpGroup = this->firstGroup;
   int counter = 0;
-  while (walker != NULL)
+  while (tmpGroup != NULL)
     {
       if (counter == groupNumber)
 	{
-	  PRINTF(4)("Drawing model number %i named %s\n", counter, walker->name);
-	  glCallList (walker->listNumber);
+	  PRINTF(4)("Drawing model number %i named %s\n", counter, tmpGroup->name);
+	  glCallList (tmpGroup->listNumber);
 	  return;
 	}
       ++counter;
-      walker = walker->next;
+      tmpGroup = tmpGroup->next;
     }
   PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name);
@@ -277,25 +267,17 @@
 {
   PRINTF(4)("drawing the requested 3D-Models if found.\n"); 
-  ModelGroup* walker = this->firstGroup;
-  while (walker != NULL)
-    {
-      if (!strcmp(walker->name, groupName))
+  ModelGroup* tmpGroup = this->firstGroup;
+  while (tmpGroup != NULL)
+    {
+      if (!strcmp(tmpGroup->name, groupName))
 	{
-	  PRINTF(4)("Drawing model %s\n", walker->name);
-	  glCallList (walker->listNumber);
+	  PRINTF(4)("Drawing model %s\n", tmpGroup->name);
+	  glCallList (tmpGroup->listNumber);
 	  return;
 	}
-      walker = walker->next;
+      tmpGroup = tmpGroup->next;
     }
   PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name);
   return;
-}
-
-/**
-   \returns Count of the Models in this File
-*/
-int Model::getGroupCount (void) const
-{
-  return this->groupCount;
 }
 
@@ -331,4 +313,5 @@
   if (this->normals)
     delete this->normals;
+
   this->vertices = NULL;
   this->vTexture = NULL;
@@ -410,5 +393,5 @@
    With it you should be able to create Models with more than one SubModel inside
 */
-bool Model::addGroup (const char* groupString)
+bool Model::addGroup(const char* groupString)
 {
   PRINTF(5)("Read Group: %s.\n", groupString);
@@ -594,5 +577,4 @@
   
   ModelFaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new ModelFaceElement;
-  tmpElem->next = NULL;
   
   va_list itemlist;
@@ -603,5 +585,4 @@
       if (this->currentGroup->currentFace->vertexCount>0)
 	tmpElem = tmpElem->next = new ModelFaceElement;
-      tmpElem->next = NULL;
 
       tmpElem->vertexNumber = va_arg (itemlist, int) -1;
@@ -834,5 +815,4 @@
   glNormalPointer(3, 0, this->normals->getArray());
   glTexCoordPointer(2, GL_FLOAT, 0, this->vTexture->getArray());
-
 }
 
@@ -859,5 +839,4 @@
   if (elem->vertexNumber != -1)
     glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
-
 }
 
Index: orxonox/trunk/src/lib/graphics/importer/model.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/model.h	(revision 4037)
+++ orxonox/trunk/src/lib/graphics/importer/model.h	(revision 4038)
@@ -139,5 +139,7 @@
   void draw(int groupNumber) const;
   void draw(char* groupName) const;
-  int getGroupCount() const;
+
+  /** \returns Count of the Models (Groups) in this File */
+  inline int getGroupCount(void) const {return this->groupCount;}
 
   Material* addMaterial(Material* material);
Index: orxonox/trunk/src/lib/graphics/importer/objModel.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 4037)
+++ orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 4038)
@@ -196,7 +196,6 @@
   this->mtlFileName = new char [strlen(mtlFile)+1];
   strcpy(this->mtlFileName, mtlFile);
-  char* fileName = new char [strlen(objPath) + strlen(this->mtlFileName)+1];
-  strcpy(fileName, this->objPath);
-  strcat(fileName, this->mtlFileName);
+  char* fileName = new char [strlen(this->objPath) + strlen(this->mtlFileName)+1];
+  sprintf(fileName, "%s%s", this->objPath, this->mtlFileName);
   
 
