Index: /trunk/src/lib/shell/shell_command.cc
===================================================================
--- /trunk/src/lib/shell/shell_command.cc	(revision 7388)
+++ /trunk/src/lib/shell/shell_command.cc	(revision 7389)
@@ -54,9 +54,6 @@
   ShellCommand::~ShellCommand()
   {
-    if (this->alias != NULL && ShellCommandClass::aliasList != NULL)
-    {
-      ShellCommandClass::aliasList->remove(this->alias);
+    if (this->alias != NULL)
       delete this->alias;
-    }
     delete this->executor;
   }
@@ -172,20 +169,17 @@
     {
       // CHECK FOR ALIAS
-      if (ShellCommandClass::aliasList != NULL)
-      {
-        std::list<ShellCommandAlias*>::iterator alias;
-        for (alias = ShellCommandClass::aliasList->begin(); alias != ShellCommandClass::aliasList->end(); alias++ )
-        {
-          if (inputSplits.getString(0) == (*alias)->getName() && (*alias)->getCommand() != NULL &&
-              (*alias)->getCommand()->shellClass != NULL )
-          {
-            objectList = ClassList::getList((*alias)->getCommand()->shellClass->getName());
-            if (objectList != NULL)
-            {
-              (*(*alias)->getCommand()->executor)(objectList->front(), inputSplits.getSubSet(1).join()); /// TODO CHECK IF OK
-              return true;
-            }
-            /// TODO CHECK FOR STATIC functions.
-          }
+      std::vector<ShellCommandAlias*>::iterator alias;
+      for (alias = ShellCommandAlias::aliasList.begin(); alias != ShellCommandAlias::aliasList.end(); alias++ )
+      {
+        if (inputSplits.getString(0) == (*alias)->getName() && (*alias)->getCommand() != NULL &&
+            (*alias)->getCommand()->shellClass != NULL )
+        {
+          objectList = ClassList::getList((*alias)->getCommand()->shellClass->getName());
+          if (objectList != NULL)
+          {
+            (*(*alias)->getCommand()->executor)(objectList->front(), inputSplits.getSubSet(1).join());
+            return true;
+          }
+          /// TODO CHECK FOR STATIC functions.
         }
       }
@@ -271,5 +265,5 @@
 
   /**
-   * adds an Alias to this Command
+   * @brief adds an Alias to this Command
    * @param alias the name of the Alias to set
    * @returns itself
@@ -286,9 +280,6 @@
     else
     {
-      if (ShellCommandClass::aliasList == NULL)
-        ShellCommandClass::aliasList = new std::list<ShellCommandAlias*>;
-
       ShellCommandAlias* aliasCMD = new ShellCommandAlias(alias, this);
-      ShellCommandClass::aliasList->push_back(aliasCMD);
+      ShellCommandAlias::aliasList.push_back(aliasCMD);
       this->alias = aliasCMD;
     }
@@ -357,3 +348,34 @@
   }
 
+
+  ShellCommandAlias::ShellCommandAlias(const std::string& aliasName, ShellCommand* command)
+  {
+    this->aliasName = aliasName;
+    this->command = command;
+    ShellCommandAlias::aliasList.push_back(this);
+  };
+
+  ShellCommandAlias::~ShellCommandAlias()
+  {
+    std::vector<ShellCommandAlias*>::iterator delA = std::find(aliasList.begin(), aliasList.end(), this);
+    if (delA != aliasList.end())
+      ShellCommandAlias::aliasList.push_back(this);
+
+  }
+
+  std::vector<ShellCommandAlias*> ShellCommandAlias::aliasList;
+  /**
+  * @brief collects the Aliases registered to the ShellCommands
+  * @param stringList a List to paste the Aliases into.
+  * @returns true on success, false otherwise
+   */
+  bool ShellCommandAlias::getCommandListOfAlias(std::list<std::string>& stringList)
+  {
+    std::vector<ShellCommandAlias*>::iterator alias;
+    for (alias = ShellCommandAlias::aliasList.begin(); alias != ShellCommandAlias::aliasList.end(); alias++)
+      stringList.push_back((*alias)->getName());
+    return true;
+  }
+
+
 }
Index: /trunk/src/lib/shell/shell_command.h
===================================================================
--- /trunk/src/lib/shell/shell_command.h	(revision 7388)
+++ /trunk/src/lib/shell/shell_command.h	(revision 7389)
@@ -101,12 +101,15 @@
     /** @returns the Command, this Alias is asociated with */
     ShellCommand* getCommand() const { return this->command; };
+    static bool getCommandListOfAlias(std::list<std::string>& stringList);
 
   private:
     /** @param aliasName the name of the Alias @param command the Command, to associate this alias with */
-    ShellCommandAlias(const std::string& aliasName, ShellCommand* command) { this->aliasName = aliasName; this->command = command; };
-
+    ShellCommandAlias(const std::string& aliasName, ShellCommand* command);
+    ~ShellCommandAlias();
   private:
     std::string     aliasName;       //!< the name of the Alias
     ShellCommand*   command;         //!< a pointer to the command, this alias executes.
+
+    static std::vector<ShellCommandAlias*> aliasList; //!< A list of Aliases to A Commands.
   };
 
Index: /trunk/src/lib/shell/shell_command_class.cc
===================================================================
--- /trunk/src/lib/shell/shell_command_class.cc	(revision 7388)
+++ /trunk/src/lib/shell/shell_command_class.cc	(revision 7389)
@@ -26,7 +26,5 @@
 namespace OrxShell
 {
-
   std::list<ShellCommandClass*>* ShellCommandClass::commandClassList = NULL;
-  std::list<ShellCommandAlias*>* ShellCommandClass::aliasList = NULL;
 
   /**
@@ -79,21 +77,5 @@
 
   /**
-   * collects the Aliases registered to the ShellCommands
-   * @param stringList a List to paste the Aliases into.
-   * @returns true on success, false otherwise
-   */
-  bool ShellCommandClass::getCommandListOfAlias(std::list<std::string>& stringList)
-  {
-    if (ShellCommandClass::aliasList == NULL)
-      return false;
-
-    std::list<ShellCommandAlias*>::iterator alias;
-    for (alias = ShellCommandClass::aliasList->begin(); alias != ShellCommandClass::aliasList->end(); alias++)
-      stringList.push_back((*alias)->getName());
-    return true;
-  }
-
-  /**
-   * unregisters all Commands that exist
+   * @brief unregisters all Commands that exist
    */
   void ShellCommandClass::unregisterAllCommands()
@@ -109,17 +91,8 @@
     }
 
-    // unregister all aliases (there should be nothing to do here :))
-    if (ShellCommandClass::aliasList != NULL)
-    {
-      std::list<ShellCommandAlias*>::iterator alias;
-      for (alias = ShellCommandClass::aliasList->begin(); alias != ShellCommandClass::aliasList->end(); alias++)
-        delete (*alias);
-      delete ShellCommandClass::aliasList;
-      ShellCommandClass::aliasList = NULL;
-    }
-  }
-
-  /**
-   * checks if a Class is already registered to the Commands' class-stack
+  }
+
+  /**
+   * @brief checks if a Class is already registered to the Commands' class-stack
    * @param className the Name of the Class to check for
    * @returns the CommandClass if found, NULL otherwise
@@ -222,5 +195,6 @@
   {
     std::vector<ShellCommand*>::iterator delC = std::find(this->commandList.begin(), this->commandList.end(), command);
-    this->commandList.erase(delC);
+    if (delC != this->commandList.end())
+      this->commandList.erase(delC);
   }
 
Index: /trunk/src/lib/shell/shell_command_class.h
===================================================================
--- /trunk/src/lib/shell/shell_command_class.h	(revision 7388)
+++ /trunk/src/lib/shell/shell_command_class.h	(revision 7389)
@@ -27,5 +27,4 @@
 
     static bool getCommandListOfClass(const std::string& className, std::list<std::string>& stringList);
-    static bool getCommandListOfAlias(std::list<std::string>& aliasList);
 
     static ShellCommandClass* getCommandClass(const std::string& className);
@@ -49,5 +48,4 @@
     std::vector<ShellCommand*>             commandList;               //!< A list of Commands from this Class
     static std::list<ShellCommandClass*>*  commandClassList;          //!< A list of Classes
-    static std::list<ShellCommandAlias*>*  aliasList;                 //!< A list of Aliases to A Commands.
   };
 
Index: /trunk/src/lib/shell/shell_completion.cc
===================================================================
--- /trunk/src/lib/shell/shell_completion.cc	(revision 7388)
+++ /trunk/src/lib/shell/shell_completion.cc	(revision 7389)
@@ -166,5 +166,5 @@
   {
     std::list<std::string> aliasList;
-    ShellCommandClass::getCommandListOfAlias(aliasList);
+    ShellCommandAlias::getCommandListOfAlias(aliasList);
     //printf("%s\n", boList->firstElement()->getName());
     if (!this->addToCompleteList(aliasList, aliasBegin, AliasCompletion))
