Index: code/trunk/src/libraries/core/Super.h
===================================================================
--- code/trunk/src/libraries/core/Super.h	(revision 9050)
+++ code/trunk/src/libraries/core/Super.h	(revision 9348)
@@ -280,7 +280,4 @@
         SUPER_NOARGS(classname, functionname)
 
-    #define SUPER_clone(classname, functionname, ...) \
-        SUPER_ARGS(classname, functionname, __VA_ARGS__)
-
     #define SUPER_changedCarrier(classname, functionname, ...) \
         SUPER_NOARGS(classname, functionname)
@@ -398,5 +395,5 @@
                     inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
                     { \
-                        (dynamic_cast<T*>(object))->T:: functionname
+                        (orxonox_cast<T*>(object))->T:: functionname
 
         /*
@@ -508,5 +505,5 @@
                 inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
                 {
-                    (dynamic_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
+                    (orxonox_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
                 }
 
@@ -566,13 +563,9 @@
         SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
 
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, clone, true, OrxonoxClass*& item)
-            (item)
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedCarrier, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(13, changedPickedUp, false)
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, changedCarrier, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedPickedUp, false)
             ()
         SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
@@ -632,5 +625,4 @@
     SUPER_INTRUSIVE_DECLARATION(changedGametype);
     SUPER_INTRUSIVE_DECLARATION(changedUsed);
-    SUPER_INTRUSIVE_DECLARATION(clone);
     SUPER_INTRUSIVE_DECLARATION(changedCarrier);
     SUPER_INTRUSIVE_DECLARATION(changedPickedUp);
Index: code/trunk/src/libraries/core/Template.cc
===================================================================
--- code/trunk/src/libraries/core/Template.cc	(revision 9050)
+++ code/trunk/src/libraries/core/Template.cc	(revision 9348)
@@ -149,4 +149,9 @@
         orxout(verbose, context::templates) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << endl;
 
+        // check if the template is applied on an object of the right type
+        Identifier* identifier = Identifier::getIdentifierByString(this->getXMLElement().Value());
+        if (!object->getIdentifier()->isA(identifier))
+            orxout(internal_warning, context::templates) << "Template was defined for " << identifier->getName() << " but the object is of type " << object->getIdentifier()->getName() << endl;
+
         Element temp = &const_cast<TiXmlElement&>(this->getXMLElement());
 
Index: code/trunk/src/libraries/core/XMLPort.h
===================================================================
--- code/trunk/src/libraries/core/XMLPort.h	(revision 9050)
+++ code/trunk/src/libraries/core/XMLPort.h	(revision 9348)
@@ -197,5 +197,5 @@
         ClassIdentifier<classname>::getIdentifier()->addXMLPortParamContainer(paramname, containername); \
     } \
-    containername->port(dynamic_cast<BaseObject*>(this), object, xmlelement, mode)
+    containername->port(orxonox_cast<BaseObject*>(this), object, xmlelement, mode)
 
 // --------------------
Index: code/trunk/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.cc	(revision 9050)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.cc	(revision 9348)
@@ -594,5 +594,5 @@
         @param bPrintError If true, an error is printed if the command doesn't exist
     */
-    /* static */ const ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
+    /* static */ ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
     {
         // find the group
@@ -624,5 +624,5 @@
         @param bPrintError If true, an error is printed if the command doesn't exist
     */
-    /* static */ const ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
+    /* static */ ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
     {
         std::string groupLC = getLowercase(group);
Index: code/trunk/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.h	(revision 9050)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.h	(revision 9348)
@@ -382,5 +382,5 @@
                 public:
                     /// Constructor: Creates a manipulator for a given ConsoleCommand.
-                    ConsoleCommandManipulator(const ConsoleCommand* command) : command_(const_cast<ConsoleCommand*>(command)) {}
+                    ConsoleCommandManipulator(ConsoleCommand* command) : command_(command) {}
 
                     /// Changes the current function of the command. @param function The new function-pointer @param bForce If true, the new function-pointer is always assigned, even if the headers don't match
@@ -619,5 +619,5 @@
 
             /// Returns a manipulator for this command.
-            inline ConsoleCommandManipulator getManipulator() const
+            inline ConsoleCommandManipulator getManipulator()
                 { return this; }
 
@@ -667,12 +667,12 @@
 
             /// Returns a command (shortcut) with given name. @param name The name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
-            static inline const ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
+            static inline ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
                 { return ConsoleCommand::getCommand("", name, bPrintError); }
             /// Returns a command (shortcut) with given name in lowercase. @param name The lowercase name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
-            static inline const ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
+            static inline ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
                 { return ConsoleCommand::getCommandLC("", name, bPrintError); }
 
-            static const ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
-            static const ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
+            static ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
+            static ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
 
             static void destroyAll();
Index: code/trunk/src/libraries/util/output/ConsoleWriter.cc
===================================================================
--- code/trunk/src/libraries/util/output/ConsoleWriter.cc	(revision 9050)
+++ code/trunk/src/libraries/util/output/ConsoleWriter.cc	(revision 9348)
