Index: code/trunk/src/modules/designtools/ScreenshotManager.cc
===================================================================
--- code/trunk/src/modules/designtools/ScreenshotManager.cc	(revision 10622)
+++ code/trunk/src/modules/designtools/ScreenshotManager.cc	(revision 10624)
@@ -45,8 +45,8 @@
 #include "core/config/ConfigValueIncludes.h"
 #include "core/GraphicsManager.h"
-#include "core/PathConfig.h"
+#include "core/ConfigurablePaths.h"
 #include "core/Resource.h"
-#include "core/command/ConsoleCommand.h"
-#include "util/ScopedSingletonManager.h"
+#include "core/command/ConsoleCommandIncludes.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "util/StringUtils.h"
 
@@ -61,5 +61,7 @@
     SetConsoleCommand("printScreenHD", &ScreenshotManager::makeScreenshot_s);
     
-    ManageScopedSingleton(ScreenshotManager, ScopeID::Graphics, false);
+    ManageScopedSingleton(ScreenshotManager, ScopeID::GRAPHICS, false);
+
+    RegisterAbstractClass(ScreenshotManager).inheritsFrom<Configurable>();
 
     /**
@@ -152,5 +154,5 @@
         {
             // Save it.
-            finalImage->save(PathConfig::getInstance().getLogPathString() + "screenshot_" + getTimestamp() + this->fileExtension_);
+            finalImage->save(ConfigurablePaths::getLogPathString() + "screenshot_" + getTimestamp() + this->fileExtension_);
             delete finalImage;
             orxout(user_info) << "Finished taking " << this->gridSize_*this->windowWidth_ << "x" << this->gridSize_*this->windowHeight_ << " pixel HD screenshot. Storing in log/." << endl;
Index: code/trunk/src/modules/designtools/SkyboxGenerator.cc
===================================================================
--- code/trunk/src/modules/designtools/SkyboxGenerator.cc	(revision 10622)
+++ code/trunk/src/modules/designtools/SkyboxGenerator.cc	(revision 10624)
@@ -38,12 +38,12 @@
 #include <OgreCamera.h>
 
-#include "util/ScopedSingletonManager.h"
 #include "core/CoreIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
 #include "core/GraphicsManager.h"
-#include "core/PathConfig.h"
+#include "core/ConfigurablePaths.h"
 #include "core/Resource.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "core/command/CommandExecutor.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 
 #include "controllers/HumanController.h"
@@ -60,5 +60,7 @@
     SetConsoleCommand("SkyboxGenerator", "createSkybox", &SkyboxGenerator::createSkybox).addShortcut();
 
-    ManageScopedSingleton(SkyboxGenerator, ScopeID::Graphics, false);
+    ManageScopedSingleton(SkyboxGenerator, ScopeID::GRAPHICS, false);
+
+    RegisterAbstractClass(SkyboxGenerator).inheritsFrom<Configurable>().inheritsFrom<Tickable>();
 
     /**
@@ -173,5 +175,5 @@
                 this->setupRenderWindow(renderWindow);
                 // Add the log path to the standard resource group.
-                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getInstance().getLogPathString(), "FileSystem", Resource::getDefaultResourceGroup());
+                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getLogPathString(), "FileSystem", Resource::getDefaultResourceGroup());
                 
                 orxout(internal_status) << "Setting up SkyboxGenerator..." << endl;
@@ -208,5 +210,5 @@
                 this->restoreRenderWindow(renderWindow);
                 // Remove the log path from the standard resource group.
-                Ogre::ResourceGroupManager::getSingleton().removeResourceLocation(PathConfig::getInstance().getLogPathString(), Resource::getDefaultResourceGroup());
+                Ogre::ResourceGroupManager::getSingleton().removeResourceLocation(ConfigurablePaths::getLogPathString(), Resource::getDefaultResourceGroup());
                 
                 // Reset the flow parameters for the next skybox generation.
@@ -306,5 +308,5 @@
     void SkyboxGenerator::saveImage(Ogre::Image* image, const std::string& name) const
     {
-        image->save(PathConfig::getInstance().getLogPathString()+name);
+        image->save(ConfigurablePaths::getLogPathString()+name);
         delete image;
         // Loading the resizing, then saving again. This seems stupid, but resizing doesn't seem to work otherwise.
@@ -313,5 +315,5 @@
         image->load(name, Resource::getDefaultResourceGroup());
         image->resize(this->size_, this->size_);
-        image->save(PathConfig::getInstance().getLogPathString()+name);
+        image->save(ConfigurablePaths::getLogPathString()+name);
         delete image;
         ScreenshotManager::getInstance().cleanup(); // Free memory in ScreenshotManager.
Index: code/trunk/src/modules/docking/Dock.cc
===================================================================
--- code/trunk/src/modules/docking/Dock.cc	(revision 10622)
+++ code/trunk/src/modules/docking/Dock.cc	(revision 10624)
@@ -37,6 +37,6 @@
 #include "core/LuaState.h"
 #include "core/GUIManager.h"
-#include "core/command/ConsoleCommand.h"
-#include "network/NetworkFunction.h"
+#include "core/command/ConsoleCommandIncludes.h"
+#include "network/NetworkFunctionIncludes.h"
 
 #include "infos/HumanPlayer.h"
@@ -184,5 +184,5 @@
             }
             else
-                callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID());
+                callStaticNetworkFunction(&Dock::showDockingDialog, player->getClientID());
 
         }
@@ -201,5 +201,5 @@
         }
         else
-            callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID());
+            callStaticNetworkFunction(&Dock::showDockingDialog, player->getClientID());
 
     }
Index: code/trunk/src/modules/docking/DockingAnimation.cc
===================================================================
--- code/trunk/src/modules/docking/DockingAnimation.cc	(revision 10622)
+++ code/trunk/src/modules/docking/DockingAnimation.cc	(revision 10624)
@@ -39,5 +39,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(DockingAnimation).inheritsFrom(Class(BaseObject));
+    RegisterAbstractClass(DockingAnimation).inheritsFrom<BaseObject>();
 
     DockingAnimation::DockingAnimation(Context* context) : BaseObject(context)
Index: code/trunk/src/modules/docking/DockingEffect.cc
===================================================================
--- code/trunk/src/modules/docking/DockingEffect.cc	(revision 10622)
+++ code/trunk/src/modules/docking/DockingEffect.cc	(revision 10624)
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(DockingEffect).inheritsFrom(Class(BaseObject));
+    RegisterAbstractClass(DockingEffect).inheritsFrom<BaseObject>();
 
     DockingEffect::DockingEffect(Context* context) : BaseObject(context)
Index: code/trunk/src/modules/dodgerace/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/dodgerace/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/dodgerace/CMakeLists.txt	(revision 10624)
@@ -8,5 +8,5 @@
 
 ORXONOX_ADD_LIBRARY(dodgerace
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   LINK_LIBRARIES
Index: code/trunk/src/modules/dodgerace/DodgeRace.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRace.cc	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRace.cc	(revision 10624)
@@ -35,4 +35,5 @@
 #include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
 #include "DodgeRaceCube.h"
+#include "core/CoreIncludes.h"
 
 namespace orxonox
@@ -43,13 +44,5 @@
     {
         RegisterObject(DodgeRace);
-        init();
-        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
-        this->center_ = 0;
-
-        this->setHUDTemplate("DodgeRaceHUD");
-    }
-
-    void DodgeRace::init()
-    {
+
         bEndGame = false;
         lives = 1;
@@ -65,4 +58,8 @@
         //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
         comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
+        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+        this->center_ = 0;
+
+        this->setHUDTemplate("DodgeRaceHUD");
     }
 
@@ -74,5 +71,5 @@
             for (int i = 0; i < 7; i++)
             {
-                WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
+                BigExplosion* chunk = new BigExplosion(this->center_->getContext());
                 chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
                 chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
@@ -90,6 +87,4 @@
         if (getPlayer() != NULL)
         {
-            //WeakPtr<DodgeRaceShip> ship = getPlayer();
-
             currentPosition = getPlayer()->getWorldPosition().x;
             counter = counter + (currentPosition - lastPosition);
@@ -112,5 +107,5 @@
                 for(int i = 0; i<6; i++)
                 {
-                    WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext());
+                    DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext());
                     cubeList.push_back(cube);
                     switch(pattern)
@@ -137,5 +132,5 @@
     }
 
-    WeakPtr<DodgeRaceShip> DodgeRace::getPlayer()
+    DodgeRaceShip* DodgeRace::getPlayer()
     {
         if (player == NULL)
@@ -168,5 +163,4 @@
     {
         orxout() << "start" << endl;
-        init();
         for(unsigned int i=0; i< cubeList.size();i++)
         {
@@ -199,5 +193,4 @@
         /*
         orxout() << "prespawn" << endl;
-        init();
         for(int i=0; i< cubeList.size();i++)
         {
Index: code/trunk/src/modules/dodgerace/DodgeRace.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRace.h	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRace.h	(revision 10624)
@@ -44,5 +44,4 @@
 
 
-#include "core/CoreIncludes.h"
 #include "core/EventIncludes.h"
 #include "core/command/Executor.h"
@@ -69,6 +68,4 @@
        public:
             DodgeRace(Context* context);
-
-            void init();
 
             virtual void start();
@@ -106,5 +103,5 @@
             Timer endGameTimer;
 
-            WeakPtr<DodgeRaceShip> getPlayer();
+            DodgeRaceShip* getPlayer();
             WeakPtr<DodgeRaceShip> player;
             std::vector<DodgeRaceCube*> cubeList;
Index: code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc	(revision 10624)
@@ -54,17 +54,9 @@
     }
 
-    void DodgeRaceCenterPoint::changedGametype()
-    {
-        SUPER(DodgeRaceCenterPoint, changedGametype);
-
-        // Check, whether it's still DodgeRace.
-        this->checkGametype();
-    }
-
     void DodgeRaceCenterPoint::checkGametype()
     {
         if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace)))
         {
-            DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype().get());
+            DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype());
             DodgeRaceGametype->setCenterpoint(this);
         }
Index: code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h	(revision 10624)
@@ -52,5 +52,4 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual void changedGametype(); //!< Is called when the gametype has changed.
         private:
             void checkGametype();
Index: code/trunk/src/modules/dodgerace/DodgeRaceCube.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceCube.cc	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRaceCube.cc	(revision 10624)
@@ -33,4 +33,5 @@
 #include "DodgeRaceCube.h"
 #include "DodgeRace.h"
+#include "core/CoreIncludes.h"
 
 namespace orxonox
Index: code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc	(revision 10624)
@@ -82,5 +82,5 @@
         if (this->getOwner() && this->getOwner()->getGametype())
         {
-            this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype().get());
+            this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype());
         }
         else
Index: code/trunk/src/modules/dodgerace/DodgeRaceShip.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceShip.cc	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRaceShip.cc	(revision 10624)
@@ -33,4 +33,5 @@
 
 #include "DodgeRaceShip.h"
+#include "core/CoreIncludes.h"
 
 namespace orxonox
@@ -89,5 +90,5 @@
 
         // Camera
-        WeakPtr<Camera> camera = this->getCamera();
+        Camera* camera = this->getCamera();
         if (camera != NULL)
         {
@@ -149,5 +150,5 @@
     }
 
-    WeakPtr<DodgeRace> DodgeRaceShip::getGame()
+    DodgeRace* DodgeRaceShip::getGame()
     {
         if (game == NULL)
Index: code/trunk/src/modules/dodgerace/DodgeRaceShip.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceShip.h	(revision 10622)
+++ code/trunk/src/modules/dodgerace/DodgeRaceShip.h	(revision 10624)
@@ -38,5 +38,4 @@
 #include "dodgerace/DodgeRacePrereqs.h"
 
-#include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
 #include "worldentities/pawns/SpaceShip.h"
@@ -79,5 +78,5 @@
         private:
             virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
-            WeakPtr<DodgeRace> getGame();
+            DodgeRace* getGame();
             WeakPtr<DodgeRace> game;
             WeakPtr<WorldEntity> lastEntity;
Index: code/trunk/src/modules/gametypes/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/gametypes/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/gametypes/CMakeLists.txt	(revision 10624)
@@ -10,5 +10,5 @@
 
 ORXONOX_ADD_LIBRARY(gametypes
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   TOLUA_FILES
Index: code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc	(revision 10622)
+++ code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc	(revision 10624)
@@ -61,5 +61,5 @@
         SUPER(OldRaceCheckPoint, tick, dt);
 
-        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
+        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype());
         assert(gametype);
         if (this->getCheckpointIndex() == gametype->getCheckpointsReached())
@@ -82,5 +82,5 @@
         DistanceTrigger::triggered(bIsTriggered);
 
-        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
+        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype());
         if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
         {
@@ -107,5 +107,5 @@
         if (this->bTimeLimit_ != 0)
         {
-            OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
+            OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype());
             if (gametype)
             {
Index: code/trunk/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 10622)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 10624)
@@ -46,5 +46,5 @@
     {
         RegisterObject(SpaceRaceManager);
-        this->race_ = orxonox_cast<SpaceRace*>(this->getGametype().get());
+        this->race_ = orxonox_cast<SpaceRace*>(this->getGametype());
         assert(race_);
         //amountOfPlayers=(race_->getPlayers()).size();
@@ -139,5 +139,5 @@
     void SpaceRaceManager::checkpointReached(RaceCheckPoint* newCheckpoint, PlayerInfo* player)
     {
-        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype());
         assert(gametype);
         if (!gametype)
Index: code/trunk/src/modules/invader/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/invader/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/invader/CMakeLists.txt	(revision 10624)
@@ -13,5 +13,5 @@
 
 ORXONOX_ADD_LIBRARY(invader
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   LINK_LIBRARIES
Index: code/trunk/src/modules/invader/Invader.cc
===================================================================
--- code/trunk/src/modules/invader/Invader.cc	(revision 10622)
+++ code/trunk/src/modules/invader/Invader.cc	(revision 10624)
@@ -62,10 +62,4 @@
         this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
         this->center_ = 0;
-        init();
-        this->setHUDTemplate("InvaderHUD");
-    }
-
-    void Invader::init()
-    {
         bEndGame = false;
         lives = 3;
@@ -78,4 +72,5 @@
         enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&Invader::spawnEnemy, this)));
         comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&Invader::comboControll, this)));
+        this->setHUDTemplate("InvaderHUD");
     }
 
@@ -87,5 +82,5 @@
             for (int i = 0; i < 7; i++)
             {
-                WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
+                BigExplosion* chunk = new BigExplosion(this->center_->getContext());
                 chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
                 chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
@@ -99,5 +94,5 @@
     }
 
-    WeakPtr<InvaderShip> Invader::getPlayer()
+    InvaderShip* Invader::getPlayer()
     {
         if (player == NULL)
@@ -116,5 +111,5 @@
         for (int i = 0; i < (3*log10(static_cast<double>(level)) + 1); i++)
         {
-            WeakPtr<InvaderEnemy> newPawn;
+            InvaderEnemy* newPawn;
             if (rand() % 42/(1 + level*level) == 0)
             {
@@ -155,5 +150,4 @@
     void Invader::start()
     {
-        init();
         // Set variable to temporarily force the player to spawn.
         this->bForceSpawn_ = true;
Index: code/trunk/src/modules/invader/Invader.h
===================================================================
--- code/trunk/src/modules/invader/Invader.h	(revision 10622)
+++ code/trunk/src/modules/invader/Invader.h	(revision 10624)
@@ -71,5 +71,4 @@
             // checks if multiplier should be reset.
             void comboControll();
-            void init();
             int lives;
             int multiplier;
@@ -78,5 +77,5 @@
         private:
             void toggleShowLevel(){bShowLevel = !bShowLevel;}
-            WeakPtr<InvaderShip> getPlayer();
+            InvaderShip* getPlayer();
             WeakPtr<InvaderCenterPoint> center_;
             WeakPtr<InvaderShip> player;
Index: code/trunk/src/modules/invader/InvaderCenterPoint.cc
===================================================================
--- code/trunk/src/modules/invader/InvaderCenterPoint.cc	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderCenterPoint.cc	(revision 10624)
@@ -54,17 +54,9 @@
     }
 
-    void InvaderCenterPoint::changedGametype()
-    {
-        SUPER(InvaderCenterPoint, changedGametype);
-
-        // Check, whether it's still Invader.
-        this->checkGametype();
-    }
-
     void InvaderCenterPoint::checkGametype()
     {
         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Invader)))
         {
-            Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype().get());
+            Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype());
             InvaderGametype->setCenterpoint(this);
         }
Index: code/trunk/src/modules/invader/InvaderCenterPoint.h
===================================================================
--- code/trunk/src/modules/invader/InvaderCenterPoint.h	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderCenterPoint.h	(revision 10624)
@@ -49,5 +49,4 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual void changedGametype(); //!< Is called when the gametype has changed.
         private:
             void checkGametype();
Index: code/trunk/src/modules/invader/InvaderEnemy.cc
===================================================================
--- code/trunk/src/modules/invader/InvaderEnemy.cc	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderEnemy.cc	(revision 10624)
@@ -69,5 +69,5 @@
     }
 
-    WeakPtr<Invader> InvaderEnemy::getGame()
+    Invader* InvaderEnemy::getGame()
     {
         if (game == NULL)
Index: code/trunk/src/modules/invader/InvaderEnemy.h
===================================================================
--- code/trunk/src/modules/invader/InvaderEnemy.h	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderEnemy.h	(revision 10624)
@@ -49,9 +49,9 @@
             virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
             virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
-            virtual void setPlayer(WeakPtr<InvaderShip> player){this->player = player;}
+            virtual void setPlayer(InvaderShip* player){this->player = player;}
 
             int level;
         protected:
-            WeakPtr<Invader> getGame();
+            Invader* getGame();
             WeakPtr<Invader> game;
             WeakPtr<InvaderShip> player;
Index: code/trunk/src/modules/invader/InvaderHUDinfo.cc
===================================================================
--- code/trunk/src/modules/invader/InvaderHUDinfo.cc	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderHUDinfo.cc	(revision 10624)
@@ -128,5 +128,5 @@
         if (this->getOwner() && this->getOwner()->getGametype())
         {
-            this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype().get());
+            this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype());
         }
         else
Index: code/trunk/src/modules/invader/InvaderShip.cc
===================================================================
--- code/trunk/src/modules/invader/InvaderShip.cc	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderShip.cc	(revision 10624)
@@ -91,5 +91,5 @@
 
         // Camera
-        WeakPtr<Camera> camera = this->getCamera();
+        Camera* camera = this->getCamera();
         if (camera != NULL)
         {
@@ -142,6 +142,6 @@
     {
         // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
-        WeakPtr<InvaderEnemy> enemy = orxonox_cast<InvaderEnemy*>(otherObject);
-        WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject);
+        InvaderEnemy* enemy = orxonox_cast<InvaderEnemy*>(otherObject);
+        Projectile* shot = orxonox_cast<Projectile*>(otherObject);
         // ensure that this gets only called once per enemy.
         if (enemy != NULL && lastEnemy != enemy)
@@ -171,5 +171,5 @@
     }
 
-    WeakPtr<Invader> InvaderShip::getGame()
+    Invader* InvaderShip::getGame()
     {
         if (game == NULL)
Index: code/trunk/src/modules/invader/InvaderShip.h
===================================================================
--- code/trunk/src/modules/invader/InvaderShip.h	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderShip.h	(revision 10624)
@@ -70,5 +70,5 @@
             virtual void death();
         private:
-            WeakPtr<Invader> getGame();
+            Invader* getGame();
             WeakPtr<Invader> game;
             Camera* camera;
Index: code/trunk/src/modules/invader/InvaderWeapon.cc
===================================================================
--- code/trunk/src/modules/invader/InvaderWeapon.cc	(revision 10622)
+++ code/trunk/src/modules/invader/InvaderWeapon.cc	(revision 10624)
@@ -68,5 +68,5 @@
         // Create the projectile.projectile
         projectile = new Projectile(this->getContext());
-        WeakPtr<Model> model = new Model(projectile->getContext());
+        Model* model = new Model(projectile->getContext());
         model->setMeshSource(mesh_);
         model->setCastShadows(false);
Index: code/trunk/src/modules/jump/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/jump/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/jump/CMakeLists.txt	(revision 10624)
@@ -24,5 +24,5 @@
 
 ORXONOX_ADD_LIBRARY(jump
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   LINK_LIBRARIES
Index: code/trunk/src/modules/jump/JumpCenterpoint.cc
===================================================================
--- code/trunk/src/modules/jump/JumpCenterpoint.cc	(revision 10622)
+++ code/trunk/src/modules/jump/JumpCenterpoint.cc	(revision 10624)
@@ -80,16 +80,9 @@
     }
 
-    void JumpCenterpoint::changedGametype()
-    {
-        SUPER(JumpCenterpoint, changedGametype);
-
-        checkGametype();
-    }
-
     void JumpCenterpoint::checkGametype()
     {
         if (getGametype() != NULL && this->getGametype()->isA(Class(Jump)))
         {
-            Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype().get());
+            Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype());
             jumpGametype->setCenterpoint(this);
         }
Index: code/trunk/src/modules/jump/JumpCenterpoint.h
===================================================================
--- code/trunk/src/modules/jump/JumpCenterpoint.h	(revision 10622)
+++ code/trunk/src/modules/jump/JumpCenterpoint.h	(revision 10624)
@@ -114,5 +114,4 @@
             virtual ~JumpCenterpoint() {}
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a JumpCenterpoint through XML.
-            virtual void changedGametype();
             void setPlatformStaticTemplate(const std::string& balltemplate)
                 { this->platformStaticTemplate_ = balltemplate; }
Index: code/trunk/src/modules/jump/JumpEnemy.cc
===================================================================
--- code/trunk/src/modules/jump/JumpEnemy.cc	(revision 10622)
+++ code/trunk/src/modules/jump/JumpEnemy.cc	(revision 10624)
@@ -151,5 +151,5 @@
         An array (of size 2) of weak pointers, to be set as the new bats.
     */
-    void JumpEnemy::setFigure(WeakPtr<JumpFigure> newFigure)
+    void JumpEnemy::setFigure(JumpFigure* newFigure)
     {
         figure_ = newFigure;
Index: code/trunk/src/modules/jump/JumpEnemy.h
===================================================================
--- code/trunk/src/modules/jump/JumpEnemy.h	(revision 10622)
+++ code/trunk/src/modules/jump/JumpEnemy.h	(revision 10624)
@@ -68,5 +68,5 @@
 
             virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed);
-            void setFigure(WeakPtr<JumpFigure> bats);
+            void setFigure(JumpFigure* newFigure);
             virtual void touchFigure();
             bool dead_;
Index: code/trunk/src/modules/jump/JumpItem.cc
===================================================================
--- code/trunk/src/modules/jump/JumpItem.cc	(revision 10622)
+++ code/trunk/src/modules/jump/JumpItem.cc	(revision 10624)
@@ -109,5 +109,5 @@
     }
 
-    void JumpItem::setFigure(WeakPtr<JumpFigure> newFigure)
+    void JumpItem::setFigure(JumpFigure* newFigure)
     {
         figure_ = newFigure;
Index: code/trunk/src/modules/jump/JumpItem.h
===================================================================
--- code/trunk/src/modules/jump/JumpItem.h	(revision 10622)
+++ code/trunk/src/modules/jump/JumpItem.h	(revision 10624)
@@ -53,5 +53,5 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed);
-            virtual void setFigure(WeakPtr<JumpFigure> bats);
+            virtual void setFigure(JumpFigure* newFigure);
             virtual void touchFigure();
 
Index: code/trunk/src/modules/jump/JumpPlatform.cc
===================================================================
--- code/trunk/src/modules/jump/JumpPlatform.cc	(revision 10622)
+++ code/trunk/src/modules/jump/JumpPlatform.cc	(revision 10624)
@@ -125,5 +125,5 @@
     }
 
-    void JumpPlatform::setFigure(WeakPtr<JumpFigure> newFigure)
+    void JumpPlatform::setFigure(JumpFigure* newFigure)
     {
         figure_ = newFigure;
Index: code/trunk/src/modules/jump/JumpPlatform.h
===================================================================
--- code/trunk/src/modules/jump/JumpPlatform.h	(revision 10622)
+++ code/trunk/src/modules/jump/JumpPlatform.h	(revision 10624)
@@ -49,5 +49,5 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            void setFigure(WeakPtr<JumpFigure> bats); //!< Set the bats for the ball.
+            void setFigure(JumpFigure* newFigure);
             virtual void touchFigure();
 
Index: code/trunk/src/modules/jump/JumpProjectile.cc
===================================================================
--- code/trunk/src/modules/jump/JumpProjectile.cc	(revision 10622)
+++ code/trunk/src/modules/jump/JumpProjectile.cc	(revision 10624)
@@ -84,5 +84,5 @@
     }
 
-    void JumpProjectile::setFigure(WeakPtr<JumpFigure> figure)
+    void JumpProjectile::setFigure(JumpFigure* figure)
     {
         figure_ = figure;
Index: code/trunk/src/modules/jump/JumpProjectile.h
===================================================================
--- code/trunk/src/modules/jump/JumpProjectile.h	(revision 10622)
+++ code/trunk/src/modules/jump/JumpProjectile.h	(revision 10624)
@@ -56,5 +56,5 @@
                 { return Vector2(this->fieldWidth_, this->fieldHeight_); }
 
-            void setFigure(WeakPtr<JumpFigure> figure);
+            void setFigure(JumpFigure* figure);
 
         protected:
Index: code/trunk/src/modules/jump/JumpScore.cc
===================================================================
--- code/trunk/src/modules/jump/JumpScore.cc	(revision 10622)
+++ code/trunk/src/modules/jump/JumpScore.cc	(revision 10624)
@@ -118,5 +118,5 @@
         if (this->getOwner() != NULL && this->getOwner()->getGametype())
         {
-            this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype().get());
+            this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype());
         }
         else
Index: code/trunk/src/modules/mini4dgame/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/mini4dgame/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/mini4dgame/CMakeLists.txt	(revision 10624)
@@ -6,5 +6,5 @@
 
 ORXONOX_ADD_LIBRARY(mini4dgame
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   LINK_LIBRARIES
Index: code/trunk/src/modules/mini4dgame/Mini4Dgame.cc
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4Dgame.cc	(revision 10622)
+++ code/trunk/src/modules/mini4dgame/Mini4Dgame.cc	(revision 10624)
@@ -45,5 +45,5 @@
 #include "core/config/ConfigValueIncludes.h"
 #include "infos/PlayerInfo.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "gamestates/GSLevel.h"
Index: code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc	(revision 10622)
+++ code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc	(revision 10624)
@@ -901,16 +901,4 @@
     /**
     @brief
-        Is called when the gametype has changed.
-    */
-    void Mini4DgameBoard::changedGametype()
-    {
-        SUPER(Mini4DgameBoard, changedGametype);
-
-        // Check, whether it's still Mini4Dgame.
-        this->checkGametype();
-    }
-
-    /**
-    @brief
         Checks whether the gametype is Mini4Dgame and if it is, sets its centerpoint.
     */
@@ -919,5 +907,5 @@
         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame)))
         {
-            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype().get());
+            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype());
             Mini4DgameGametype->setGameboard(this);
         }
Index: code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h	(revision 10622)
+++ code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h	(revision 10624)
@@ -81,5 +81,4 @@
             Mini4DgameWinner getWinner();
 
-            void changedGametype();
             void checkGametype();
 
Index: code/trunk/src/modules/notifications/NotificationDispatcher.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationDispatcher.cc	(revision 10622)
+++ code/trunk/src/modules/notifications/NotificationDispatcher.cc	(revision 10624)
@@ -37,5 +37,5 @@
 #include "core/EventIncludes.h"
 #include "core/XMLPort.h"
-#include "network/NetworkFunction.h"
+#include "network/NetworkFunctionIncludes.h"
 #include "network/Host.h"
 
@@ -118,5 +118,5 @@
         if(!GameMode::isStandalone())
         {
-            callMemberNetworkFunction(NotificationDispatcher, broadcastHelper, this->getObjectID(), NETWORK_PEER_ID_BROADCAST);
+            callMemberNetworkFunction(&NotificationDispatcher::broadcastHelper, this->getObjectID(), NETWORK_PEER_ID_BROADCAST);
         }
     }
@@ -148,5 +148,5 @@
         else if(GameMode::isServer())
         {
-            callMemberNetworkFunction(NotificationDispatcher, dispatch, this->getObjectID(), clientId, clientId);
+            callMemberNetworkFunction(&NotificationDispatcher::dispatch, this->getObjectID(), clientId, clientId);
         }
     }
Index: code/trunk/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationManager.cc	(revision 10622)
+++ code/trunk/src/modules/notifications/NotificationManager.cc	(revision 10624)
@@ -37,5 +37,5 @@
 #include "core/CoreIncludes.h"
 #include "core/LuaState.h"
-#include "util/ScopedSingletonManager.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 
 #include "interfaces/NotificationListener.h"
@@ -47,5 +47,7 @@
 {
 
-    ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
+    ManageScopedSingleton(NotificationManager, ScopeID::ROOT, false);
+
+    RegisterAbstractClass(NotificationManager).inheritsFrom<NotificationListener>();
 
     /**
Index: code/trunk/src/modules/objects/Planet.cc
===================================================================
--- code/trunk/src/modules/objects/Planet.cc	(revision 10622)
+++ code/trunk/src/modules/objects/Planet.cc	(revision 10624)
@@ -85,8 +85,4 @@
 
         SUPER(Planet, tick, dt);
-    }
-
-    void Planet::init()
-    {
     }
 
Index: code/trunk/src/modules/objects/Planet.h
===================================================================
--- code/trunk/src/modules/objects/Planet.h	(revision 10622)
+++ code/trunk/src/modules/objects/Planet.h	(revision 10624)
@@ -52,5 +52,4 @@
             virtual ~Planet();
 
-            void init();
             virtual void tick(float dt);
 
Index: code/trunk/src/modules/objects/Script.cc
===================================================================
--- code/trunk/src/modules/objects/Script.cc	(revision 10622)
+++ code/trunk/src/modules/objects/Script.cc	(revision 10624)
@@ -37,5 +37,5 @@
 #include "core/XMLPort.h"
 #include "network/Host.h"
-#include "network/NetworkFunction.h"
+#include "network/NetworkFunctionIncludes.h"
 
 #include "PlayerManager.h"
@@ -198,5 +198,5 @@
                 for(std::map<unsigned int, PlayerInfo*>::const_iterator it = clients.begin(); it != clients.end(); it++)
                 {
-                    callStaticNetworkFunction(Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
+                    callStaticNetworkFunction(&Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
                     if(this->times_ != Script::INF) // Decrement the number of remaining executions.
                     {
@@ -210,5 +210,5 @@
             else
             {
-                callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
+                callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
                 if(this->times_ != Script::INF) // Decrement the number of remaining executions.
                     this->remainingExecutions_--;
@@ -248,5 +248,5 @@
         if(GameMode::isServer() && this->isOnLoad())
         {
-            callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
+            callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
         }
     }
Index: code/trunk/src/modules/objects/SpaceBoundaries.cc
===================================================================
--- code/trunk/src/modules/objects/SpaceBoundaries.cc	(revision 10622)
+++ code/trunk/src/modules/objects/SpaceBoundaries.cc	(revision 10624)
@@ -210,5 +210,5 @@
         for( std::list<WeakPtr<Pawn> >::iterator current = pawnsIn_.begin(); current != pawnsIn_.end(); current++ )
         {
-            Pawn* currentPawn = current->get();
+            Pawn* currentPawn = *current;
             if( currentPawn && currentPawn->getNode() ) 
             {
Index: code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc	(revision 10624)
@@ -40,5 +40,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom(Class(CollisionShape));
+    RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom<CollisionShape>();
 
     /**
Index: code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc	(revision 10624)
@@ -58,11 +58,4 @@
     }
 
-    BoxCollisionShape::~BoxCollisionShape()
-    {
-        // TODO: Move to CollisionShape?
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     void BoxCollisionShape::registerVariables()
     {
Index: code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h	(revision 10624)
@@ -58,5 +58,4 @@
         public:
             BoxCollisionShape(Context* context);
-            virtual ~BoxCollisionShape();
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Index: code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc	(revision 10624)
@@ -54,10 +54,4 @@
     }
 
-    ConeCollisionShape::~ConeCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     /**
     @brief
Index: code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h	(revision 10624)
@@ -56,5 +56,4 @@
         public:
             ConeCollisionShape(Context* context);
-            virtual ~ConeCollisionShape();
 
         private:
Index: code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc	(revision 10624)
@@ -54,10 +54,4 @@
     }
 
-    CylinderCollisionShape::~CylinderCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     /**
     @brief
Index: code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h	(revision 10624)
@@ -53,5 +53,4 @@
         public:
             CylinderCollisionShape(Context* context);
-            virtual ~CylinderCollisionShape();
 
         private:
Index: code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc	(revision 10624)
@@ -59,10 +59,4 @@
     }
 
-    PlaneCollisionShape::~PlaneCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     void PlaneCollisionShape::registerVariables()
     {
Index: code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h	(revision 10624)
@@ -58,5 +58,4 @@
         public:
             PlaneCollisionShape(Context* context);
-            virtual ~PlaneCollisionShape();
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Index: code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc	(revision 10624)
@@ -58,10 +58,4 @@
     }
 
-    SphereCollisionShape::~SphereCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     void SphereCollisionShape::registerVariables()
     {
Index: code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h	(revision 10624)
@@ -56,5 +56,4 @@
         public:
             SphereCollisionShape(Context* context);
-            virtual ~SphereCollisionShape();
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Index: code/trunk/src/modules/objects/triggers/CheckPoint.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 10624)
@@ -93,5 +93,5 @@
         DistanceTrigger::triggered(bIsTriggered);
 
-        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype().get());
+        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype());
         if (gametype)
         {
Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 10624)
@@ -100,13 +100,12 @@
 
         // Check for objects that were in range but no longer are. Iterate through all objects, that are in range.
-        for(std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator it = this->range_.begin(); it != this->range_.end(); )
+        for(std::set<WeakPtr<WorldEntity> >::iterator it = this->range_.begin(); it != this->range_.end(); )
         {
-            WorldEntity* entity = it->second->get();
-            WorldEntity* key = it->first;
-            it++; // Incrementing the iterator in advance, since we don't need the current anymore and we potentially are going to delete the current element thus invalidating the iterator.
+            WorldEntity* entity = *it;
+
             // If the entity no longer exists.
             if(entity == NULL)
             {
-                this->removeFromRange(key);
+                this->range_.erase(it++);
                 continue;
             }
@@ -116,7 +115,5 @@
             if (distanceVec.length() > this->distance_)
             {
-                // If for some reason the entity could not be removed.
-                if(!this->removeFromRange(key))
-                    continue;
+                this->range_.erase(it++);
 
                 // If no queue has been created, yet.
@@ -129,4 +126,8 @@
                 state->originator = entity;
                 queue->push(state);
+            }
+            else
+            {
+                ++it;
             }
         }
@@ -260,32 +261,6 @@
     bool DistanceMultiTrigger::addToRange(WorldEntity* entity)
     {
-        WeakPtr<WorldEntity>* weakptr = new WeakPtr<WorldEntity>(entity);
-        std::pair<std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator, bool> pair = this->range_.insert(std::pair<WorldEntity*, WeakPtr<WorldEntity>* >(entity, weakptr));
-
-        if(!pair.second)
-        {
-            delete weakptr;
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-    @brief
-        Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
-    @param entity
-        A pointer ot the entity.
-    @return
-        Returns true if successful.
-    */
-    bool DistanceMultiTrigger::removeFromRange(WorldEntity* entity)
-    {
-        WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second;
-        bool erased = this->range_.erase(entity) > 0;
-        if(erased)
-            delete weakptr;
-        return erased;
-    }
-
+        std::pair<std::set<WeakPtr<WorldEntity> >::iterator, bool> pair = this->range_.insert(entity);
+        return pair.second;
+    }
 }
Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 10624)
@@ -140,5 +140,4 @@
 
             bool addToRange(WorldEntity* entity); // Add a given entity to the entities, that currently are in range of the DistanceMultiTrigger.
-            bool removeFromRange(WorldEntity* entity); // Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
 
         private:
@@ -154,5 +153,5 @@
             ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.
 
-            std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
+            std::set<WeakPtr<WorldEntity> > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
 
     };
Index: code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 10624)
@@ -147,7 +147,7 @@
     {
         // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done.
-        if(this->cache_.get() != NULL)
-        {
-            if((this->cache_.get()->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
+        if(this->cache_ != NULL)
+        {
+            if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
                 return true;
             else
@@ -213,5 +213,5 @@
                 
                 // Add the entity to the cache.
-                this->cache_ = WeakPtr<WorldEntity>(entity);
+                this->cache_ = entity;
 
                 return true;
Index: code/trunk/src/modules/objects/triggers/Trigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/Trigger.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/Trigger.cc	(revision 10624)
@@ -38,5 +38,5 @@
 #include "core/GameMode.h"
 #include "core/XMLPort.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "Scene.h"
Index: code/trunk/src/modules/overlays/hud/HUDHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDHealthBar.h	(revision 10622)
+++ code/trunk/src/modules/overlays/hud/HUDHealthBar.h	(revision 10624)
@@ -115,5 +115,5 @@
         private:
             WeakPtr<Pawn> owner_;
-            SmartPtr<OverlayText> textoverlay_;
+            StrongPtr<OverlayText> textoverlay_;
             bool bUseBarColour_;
             ColourValue textColour_;
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 10622)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 10624)
@@ -41,5 +41,5 @@
 #include "util/Math.h"
 #include "util/Convert.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
Index: code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc	(revision 10622)
+++ code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc	(revision 10624)
@@ -87,5 +87,5 @@
         {
             this->player_ = orxonox_cast<PlayerInfo*>(this->getOwner());
-            this->lms_ = orxonox_cast<LastManStanding*>(this->getOwner()->getGametype().get());
+            this->lms_ = orxonox_cast<LastManStanding*>(this->getOwner()->getGametype());
         }
         else
Index: code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc	(revision 10622)
+++ code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc	(revision 10624)
@@ -87,5 +87,5 @@
         {
             this->player_ = orxonox_cast<PlayerInfo*>(this->getOwner());
-            this->lts_ = orxonox_cast<LastTeamStanding*>(this->getOwner()->getGametype().get());
+            this->lts_ = orxonox_cast<LastTeamStanding*>(this->getOwner()->getGametype());
         }
         else
Index: code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc	(revision 10622)
+++ code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc	(revision 10624)
@@ -118,5 +118,5 @@
 
         if (this->getOwner() && this->getOwner()->getGametype())
-            this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype().get());
+            this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype());
         else
             this->owner_ = 0;
Index: code/trunk/src/modules/pickup/CollectiblePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.cc	(revision 10622)
+++ code/trunk/src/modules/pickup/CollectiblePickup.cc	(revision 10624)
@@ -40,5 +40,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(CollectiblePickup).inheritsFrom(Class(Pickupable));
+    RegisterAbstractClass(CollectiblePickup).inheritsFrom<Pickupable>();
 
     /**
Index: code/trunk/src/modules/pickup/PickupManager.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.cc	(revision 10622)
+++ code/trunk/src/modules/pickup/PickupManager.cc	(revision 10624)
@@ -38,7 +38,7 @@
 #include "core/GUIManager.h"
 #include "core/class/Identifier.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "network/Host.h"
-#include "network/NetworkFunction.h"
-#include "util/ScopedSingletonManager.h"
+#include "network/NetworkFunctionIncludes.h"
 
 #include "infos/PlayerInfo.h"
@@ -51,5 +51,5 @@
 namespace orxonox
 {
-    ManageScopedSingleton(PickupManager, ScopeID::Root, false);
+    ManageScopedSingleton(PickupManager, ScopeID::ROOT, false);
 
     // Initialization of the name of the PickupInventory GUI.
@@ -62,4 +62,6 @@
     registerStaticNetworkFunction(PickupManager::usePickupNetworked);
 
+    RegisterAbstractClass(PickupManager).inheritsFrom<PickupListener>();
+
     /**
     @brief
@@ -94,6 +96,4 @@
 
         // Destroying all the WeakPointers that are still there.
-        for(std::map<uint32_t, WeakPtr<Pickupable>*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-            delete it->second;
         this->pickups_.clear();
 
@@ -212,5 +212,5 @@
         else
         {
-            callStaticNetworkFunction(PickupManager::pickupChangedUsedNetwork, clientId, index, used, pickup->isUsable(), pickup->isUnusable());
+            callStaticNetworkFunction(&PickupManager::pickupChangedUsedNetwork, clientId, index, used, pickup->isUsable(), pickup->isUnusable());
         }
     }
@@ -286,5 +286,5 @@
             // Add the Pickupable to the indexes_ and pickups_ lists.
             this->indexes_[pickup] = index;
-            this->pickups_[index] = new WeakPtr<Pickupable>(pickup);
+            this->pickups_[index] = pickup;
         }
         else // If it was dropped, it is removed from the required lists.
@@ -294,9 +294,7 @@
             index = it->second;
 
-            // Remove the Pickupable form the indexes_ and pickups_ list.
-            WeakPtr<Pickupable>* ptr = this->pickups_[index];
+            // Remove the Pickupable from the indexes_ and pickups_ list.
             this->indexes_.erase(it);
             this->pickups_.erase(index);
-            delete ptr;
         }
 
@@ -316,9 +314,9 @@
             if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end())
             {
-                callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
+                callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
             }
             else
             {
-                callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp);
+                callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp);
             }
         }
@@ -400,5 +398,5 @@
             if(this->pickups_.empty())
                 return;
-            Pickupable* pickupable = this->pickups_.find(pickup)->second->get();
+            Pickupable* pickupable = this->pickups_.find(pickup)->second;
             if(pickupable != NULL)
                 pickupable->drop();
@@ -407,5 +405,5 @@
         else
         {
-            callStaticNetworkFunction(PickupManager::dropPickupNetworked, 0, pickup);
+            callStaticNetworkFunction(&PickupManager::dropPickupNetworked, 0, pickup);
         }
     }
@@ -443,5 +441,5 @@
             if(this->pickups_.empty())
                 return;
-            Pickupable* pickupable = this->pickups_.find(pickup)->second->get();
+            Pickupable* pickupable = this->pickups_.find(pickup)->second;
             if(pickupable != NULL)
                 pickupable->setUsed(use);
@@ -450,5 +448,5 @@
         else
         {
-            callStaticNetworkFunction(PickupManager::usePickupNetworked, 0, pickup, use);
+            callStaticNetworkFunction(&PickupManager::usePickupNetworked, 0, pickup, use);
         }
     }
Index: code/trunk/src/modules/pickup/PickupManager.h
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.h	(revision 10622)
+++ code/trunk/src/modules/pickup/PickupManager.h	(revision 10624)
@@ -161,5 +161,5 @@
             std::map<uint32_t, PickupInventoryContainer*>::iterator pickupsIterator_; //!< An iterator pointing to the current Pickupable in pickupsList_.
 
-            std::map<uint32_t, WeakPtr<Pickupable>*> pickups_; //!< Map linking a number identifying a Pickupable to a weak pointer of a Pickupable.
+            std::map<uint32_t, WeakPtr<Pickupable> > pickups_; //!< Map linking a number identifying a Pickupable to a weak pointer of a Pickupable.
             std::map<Pickupable*, uint32_t> indexes_;//!< Map linking Pickupable to the number identifying it.
 
Index: code/trunk/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 10622)
+++ code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 10624)
@@ -145,5 +145,6 @@
         if(GameMode::isMaster() && this->isActive())
         {
-            WeakPtr<PickupSpawner> spawner = this; // Create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
+            // TODO: why is this a WeakPtr when the comment says StrongPtr?
+            WeakPtr<PickupSpawner> spawner = this; // Create a strong pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
 
             // Remove PickupCarriers from the blocked list if they have exceeded their time.
Index: code/trunk/src/modules/pickup/items/ShrinkPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/ShrinkPickup.cc	(revision 10622)
+++ code/trunk/src/modules/pickup/items/ShrinkPickup.cc	(revision 10624)
@@ -182,5 +182,5 @@
 
                 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
-                const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
+                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
                 int size = cameraPositions.size();
                 for(int index = 0; index < size; index++)
@@ -208,5 +208,5 @@
 
                 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
-                const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
+                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
                 int size = cameraPositions.size();
                 for(int index = 0; index < size; index++)
@@ -263,5 +263,5 @@
 
                 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
-                const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
+                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
                 int size = cameraPositions.size();
                 for(int index = 0; index < size; index++)
@@ -304,5 +304,5 @@
 
                 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
-                const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
+                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
                 int size = cameraPositions.size();
                 for(int index = 0; index < size; index++)
Index: code/trunk/src/modules/pong/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pong/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/pong/CMakeLists.txt	(revision 10624)
@@ -12,5 +12,5 @@
 
 ORXONOX_ADD_LIBRARY(pong
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   LINK_LIBRARIES
Index: code/trunk/src/modules/pong/PongCenterpoint.cc
===================================================================
--- code/trunk/src/modules/pong/PongCenterpoint.cc	(revision 10622)
+++ code/trunk/src/modules/pong/PongCenterpoint.cc	(revision 10624)
@@ -80,16 +80,4 @@
     /**
     @brief
-        Is called when the gametype has changed.
-    */
-    void PongCenterpoint::changedGametype()
-    {
-        SUPER(PongCenterpoint, changedGametype);
-
-        // Check, whether it's still Pong.
-        this->checkGametype();
-    }
-
-    /**
-    @brief
         Checks whether the gametype is Pong and if it is, sets its centerpoint.
     */
@@ -98,5 +86,5 @@
         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Pong)))
         {
-            Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype().get());
+            Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype());
             pongGametype->setCenterpoint(this);
         }
Index: code/trunk/src/modules/pong/PongCenterpoint.h
===================================================================
--- code/trunk/src/modules/pong/PongCenterpoint.h	(revision 10622)
+++ code/trunk/src/modules/pong/PongCenterpoint.h	(revision 10624)
@@ -126,6 +126,4 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a PongCenterpoint through XML.
 
-            virtual void changedGametype(); //!< Is called when the gametype has changed.
-
             /**
             @brief Set the template for the ball. (e.g. to attach the model of the ball, but also to attach an EventListener to it to detect, when it hits the boundaries, and e.g. display some ParticleEffets, when it does.)
Index: code/trunk/src/modules/pong/PongScore.cc
===================================================================
--- code/trunk/src/modules/pong/PongScore.cc	(revision 10622)
+++ code/trunk/src/modules/pong/PongScore.cc	(revision 10624)
@@ -170,5 +170,5 @@
 
         if (this->getOwner() != NULL && this->getOwner()->getGametype())
-            this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype().get());
+            this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype());
         else
             this->owner_ = 0;
Index: code/trunk/src/modules/questsystem/Quest.cc
===================================================================
--- code/trunk/src/modules/questsystem/Quest.cc	(revision 10622)
+++ code/trunk/src/modules/questsystem/Quest.cc	(revision 10624)
@@ -45,5 +45,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(Quest).inheritsFrom(Class(QuestItem));
+    RegisterAbstractClass(Quest).inheritsFrom<QuestItem>();
 
     /**
Index: code/trunk/src/modules/questsystem/QuestEffect.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestEffect.cc	(revision 10622)
+++ code/trunk/src/modules/questsystem/QuestEffect.cc	(revision 10624)
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(QuestEffect).inheritsFrom(Class(BaseObject));
+    RegisterAbstractClass(QuestEffect).inheritsFrom<BaseObject>();
 
     /**
Index: code/trunk/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestManager.cc	(revision 10622)
+++ code/trunk/src/modules/questsystem/QuestManager.cc	(revision 10624)
@@ -36,5 +36,5 @@
 #include "util/Exception.h"
 #include "util/OrxAssert.h"
-#include "util/ScopedSingletonManager.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "core/command/ConsoleCommand.h"
 #include "core/GUIManager.h"
@@ -49,5 +49,5 @@
 namespace orxonox
 {
-    ManageScopedSingleton(QuestManager, ScopeID::Root, false);
+    ManageScopedSingleton(QuestManager, ScopeID::ROOT, false);
 
     /**
Index: code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc
===================================================================
--- code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc	(revision 10622)
+++ code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc	(revision 10624)
@@ -42,5 +42,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(ChangeQuestStatus).inheritsFrom(Class(QuestEffect));
+    RegisterAbstractClass(ChangeQuestStatus).inheritsFrom<QuestEffect>();
 
     /**
Index: code/trunk/src/modules/tetris/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/tetris/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/tetris/CMakeLists.txt	(revision 10624)
@@ -8,5 +8,5 @@
 
 ORXONOX_ADD_LIBRARY(tetris
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   LINK_LIBRARIES
Index: code/trunk/src/modules/tetris/Tetris.cc
===================================================================
--- code/trunk/src/modules/tetris/Tetris.cc	(revision 10622)
+++ code/trunk/src/modules/tetris/Tetris.cc	(revision 10624)
@@ -104,5 +104,5 @@
         }
 
-        for (std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        for (std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
             (*it)->destroy();
         this->stones_.clear();
@@ -136,5 +136,5 @@
             return false;
 
-        for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
         {
             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
@@ -192,5 +192,5 @@
 
         // check for collisions with all stones
-        for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
         {
             //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
@@ -469,7 +469,7 @@
         {
             stonesPerRow = 0;
-            for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
-            {
-                std::list<SmartPtr<TetrisStone> >::iterator it_temp = it++;
+            for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
+            {
+                std::list<StrongPtr<TetrisStone> >::iterator it_temp = it++;
                 correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize());
                 if(correctPosition == row)
@@ -491,5 +491,5 @@
     void Tetris::clearRow(unsigned int row)
     {// clear the full row
-        for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
+        for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
         {
             if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row)
@@ -502,5 +502,5 @@
         }
       // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug.
-        for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
         {
             if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
Index: code/trunk/src/modules/tetris/Tetris.h
===================================================================
--- code/trunk/src/modules/tetris/Tetris.h	(revision 10622)
+++ code/trunk/src/modules/tetris/Tetris.h	(revision 10624)
@@ -69,5 +69,5 @@
 
             PlayerInfo* getPlayer(void) const; //!< Get the player.
-            WeakPtr<TetrisCenterpoint> getCenterpoint(void)
+            TetrisCenterpoint* getCenterpoint(void)
                 { return this->center_; }
 
@@ -93,5 +93,5 @@
 
             WeakPtr<TetrisCenterpoint> center_; //!< The playing field.
-            std::list<SmartPtr<TetrisStone> > stones_; //!< A list of all stones in play.
+            std::list<StrongPtr<TetrisStone> > stones_; //!< A list of all stones in play.
             WeakPtr<TetrisBrick> activeBrick_;
             WeakPtr<TetrisBrick> futureBrick_;
Index: code/trunk/src/modules/tetris/TetrisBrick.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisBrick.cc	(revision 10622)
+++ code/trunk/src/modules/tetris/TetrisBrick.cc	(revision 10624)
@@ -169,5 +169,5 @@
         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
         {
-            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
+            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
             return tetrisGametype;
         }
Index: code/trunk/src/modules/tetris/TetrisCenterpoint.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisCenterpoint.cc	(revision 10622)
+++ code/trunk/src/modules/tetris/TetrisCenterpoint.cc	(revision 10624)
@@ -80,16 +80,4 @@
     /**
     @brief
-        Is called when the gametype has changed.
-    */
-    void TetrisCenterpoint::changedGametype()
-    {
-        SUPER(TetrisCenterpoint, changedGametype);
-
-        // Check, whether it's still Tetris.
-        this->checkGametype();
-    }
-
-    /**
-    @brief
         Checks whether the gametype is Tetris and if it is, sets its centerpoint.
     */
@@ -98,5 +86,5 @@
         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
         {
-            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
+            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
             tetrisGametype->setCenterpoint(this);
         }
Index: code/trunk/src/modules/tetris/TetrisCenterpoint.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisCenterpoint.h	(revision 10622)
+++ code/trunk/src/modules/tetris/TetrisCenterpoint.h	(revision 10624)
@@ -64,6 +64,4 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a TetrisCenterpoint through XML.
 
-            virtual void changedGametype(); //!< Is called when the gametype has changed.
-            
             /**
             @brief Set the width of the playing field.
Index: code/trunk/src/modules/tetris/TetrisScore.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisScore.cc	(revision 10622)
+++ code/trunk/src/modules/tetris/TetrisScore.cc	(revision 10624)
@@ -118,5 +118,5 @@
 
         if (this->getOwner() != NULL && this->getOwner()->getGametype())
-            this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype().get());
+            this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype());
         else
             this->owner_ = 0;
Index: code/trunk/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/towerdefense/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/modules/towerdefense/CMakeLists.txt	(revision 10624)
@@ -11,5 +11,5 @@
 
 ORXONOX_ADD_LIBRARY(towerdefense
-  MODULE
+  PLUGIN
   FIND_HEADER_FILES
   LINK_LIBRARIES
Index: code/trunk/src/modules/towerdefense/TDCoordinate.h
===================================================================
--- code/trunk/src/modules/towerdefense/TDCoordinate.h	(revision 10622)
+++ code/trunk/src/modules/towerdefense/TDCoordinate.h	(revision 10624)
@@ -2,5 +2,4 @@
 #define _TDCoordinate_H__
 
-#include "core/CoreIncludes.h"
 #include "TDCoordinate.h"
 //#include "towerdefense/TowerDefense.h"
@@ -13,5 +12,5 @@
 //Class to save the Coordinates in a class instead of struct
 //Convert 2d coordinates to 3d in order to set waypoints
-    class _TowerDefenseExport TDCoordinate : public OrxonoxClass
+    class _TowerDefenseExport TDCoordinate
     {
         public:
Index: code/trunk/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 10622)
+++ code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 10624)
@@ -85,5 +85,5 @@
 #include "core/CoreIncludes.h"
 /* Part of a temporary hack to allow the player to add towers */
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include <cmath>
 
Index: code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc	(revision 10622)
+++ code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc	(revision 10624)
@@ -83,16 +83,4 @@
     /**
     @brief
-        Is called when the gametype has changed.
-    */
-    void TowerDefenseCenterpoint::changedGametype()
-    {
-        SUPER(TowerDefenseCenterpoint, changedGametype);
-
-        // Check, whether it's still TowerDefense.
-        this->checkGametype();
-    }
-
-    /**
-    @brief
         Checks whether the gametype is TowerDefense and if it is, sets its centerpoint.
     */
@@ -102,5 +90,5 @@
         {
             // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point
-            TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype().get());
+            TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype());
             towerDefenseGametype->setCenterpoint(this);
         }
Index: code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h	(revision 10622)
+++ code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h	(revision 10624)
@@ -53,5 +53,4 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void changedGametype();
 
             /**
Index: code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10622)
+++ code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10624)
@@ -29,5 +29,5 @@
         this->setCollisionType(WorldEntity::Dynamic);
         //needed to keep track of the PlayerStats coded in TowerDefense.h
-        this->td = orxonox_cast<TowerDefense*>(this->getGametype().get());
+        this->td = orxonox_cast<TowerDefense*>(this->getGametype());
         once_=false;
 
@@ -53,5 +53,5 @@
     }
 
-    WeakPtr<TowerDefense> TowerDefenseEnemy::getGame()
+    TowerDefense* TowerDefenseEnemy::getGame()
     {
         if (game == NULL)
Index: code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h	(revision 10622)
+++ code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h	(revision 10624)
@@ -47,5 +47,5 @@
 
     private:
-        WeakPtr<TowerDefense> getGame();
+        TowerDefense* getGame();
         WeakPtr<TowerDefense> game;
         TowerDefense* td;
Index: code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc	(revision 10622)
+++ code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc	(revision 10624)
@@ -80,5 +80,5 @@
             if (this->getOwner() && this->getOwner()->getGametype())
                     {
-                        this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype().get());
+                        this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype());
                     }
                     else
Index: code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc	(revision 10622)
+++ code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc	(revision 10624)
@@ -54,5 +54,6 @@
             this->particles_->setKeepParticlesInLocalSpace(0);
 
-            this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT);
+            for (unsigned int i = 0; i < this->particles_->getNumEmitters(); ++i)
+                this->particles_->getEmitter(i)->setDirection(-WorldEntity::FRONT);
         }
         else
