Index: /code/branches/core7/src/libraries/core/class/Identifier.cc
===================================================================
--- /code/branches/core7/src/libraries/core/class/Identifier.cc	(revision 10370)
+++ /code/branches/core7/src/libraries/core/class/Identifier.cc	(revision 10371)
@@ -154,60 +154,64 @@
         }
 
-        for (std::set<const Identifier*>::const_iterator it = initializationTrace.begin(); it != initializationTrace.end(); ++it)
-            if (*it != this)
-                this->parents_.insert(*it);
-    }
-
-    /**
-     * @brief Initializes the direct parents of this Identifier while creating the class hierarchy. This is only intended for abstract classes.
+        if (this->directParents_.empty())
+        {
+            for (std::set<const Identifier*>::const_iterator it = initializationTrace.begin(); it != initializationTrace.end(); ++it)
+                if (*it != this)
+                    this->parents_.insert(*it);
+        }
+        else
+            orxout(internal_error) << "Trying to add parents to " << this->getName() << " after it was already initialized with manual calls to inheritsFrom<Class>()." << endl;
+    }
+
+    /**
+     * @brief Finishes the initialization of this Identifier after creating the class hierarchy by wiring the (direct) parent/child references correctly.
      */
-    void Identifier::initializeDirectParentsOfAbstractClass()
+    void Identifier::finishInitialization()
     {
         if (!IdentifierManager::getInstance().isCreatingHierarchy())
         {
-            orxout(internal_warning) << "Identifier::initializeDirectParentsOfAbstractClass() created outside of class hierarchy creation" << endl;
+            orxout(internal_warning) << "Identifier::finishInitialization() created outside of class hierarchy creation" << endl;
             return;
         }
 
-        // only Identifiable is allowed to have no parents (even tough it's currently not abstract)
-        if (this->directParents_.empty() && !this->isExactlyA(Class(Identifiable)))
-        {
+        if (this->isInitialized())
+            return;
+
+        if (!this->parents_.empty())
+        {
+            // parents defined -> this class was initialized by creating a sample instance and recording the trace of identifiers
+
+            // initialize all parents
+            for (std::set<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
+                const_cast<Identifier*>(*it)->finishInitialization(); // initialize parent
+
+            // parents of parents are no direct parents of this identifier
+            this->directParents_ = this->parents_;
+            for (std::set<const Identifier*>::const_iterator it_parent = this->parents_.begin(); it_parent != this->parents_.end(); ++it_parent)
+                for (std::set<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
+                    this->directParents_.erase(*it_parent_parent);
+        }
+        else if (!this->directParents_.empty())
+        {
+            // no parents defined -> this class was manually initialized by calling inheritsFrom<Class>()
+
+            // initialize all direct parents
+            for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+                const_cast<Identifier*>(*it)->finishInitialization(); // initialize parent
+
+            // direct parents and their parents are also parents of this identifier (but only add them once)
+            this->parents_ = this->directParents_;
+            for (std::set<const Identifier*>::const_iterator it_parent = this->directParents_.begin(); it_parent != this->directParents_.end(); ++it_parent)
+                for (std::set<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
+                    if (std::find(this->parents_.begin(), this->parents_.end(), *it_parent_parent) == this->parents_.end())
+                        this->parents_.insert(*it_parent_parent);
+        }
+        else if (!this->isExactlyA(Class(Identifiable)))
+        {
+            // only Identifiable is allowed to have no parents (even tough it's currently not abstract)
             orxout(internal_error) << "Identifier " << this->getName() << " / " << this->getTypeidName() << " is marked as abstract but has no direct parents defined" << endl;
             orxout(internal_error) << "  If this class is not abstract, use RegisterClass(ThisClass);" << endl;
             orxout(internal_error) << "  If this class is abstract, use RegisterAbstractClass(ThisClass).inheritsFrom(Class(BaseClass));" << endl;
         }
-    }
-
-    /**
-     * @brief Finishes the initialization of this Identifier after creating the class hierarchy by wiring the (direct) parent/child references correctly.
-     */
-    void Identifier::finishInitialization()
-    {
-        if (!IdentifierManager::getInstance().isCreatingHierarchy())
-        {
-            orxout(internal_warning) << "Identifier::finishInitialization() created outside of class hierarchy creation" << endl;
-            return;
-        }
-
-        if (this->isInitialized())
-            return;
-
-        // if no direct parents were defined, initialize them with the set of all parents
-        if (this->directParents_.empty())
-            this->directParents_ = this->parents_;
-
-        // initialize all parents before continuing to initialize this identifier
-        for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
-        {
-            Identifier* directParent = const_cast<Identifier*>(*it);
-            directParent->finishInitialization(); // initialize parent
-            this->parents_.insert(directParent);  // direct parent is also a parent
-            this->parents_.insert(directParent->parents_.begin(), directParent->parents_.end()); // parents of direct parent are also parents
-        }
-
-        // parents of parents are no direct parents of this identifier
-        for (std::set<const Identifier*>::const_iterator it_parent = this->parents_.begin(); it_parent != this->parents_.end(); ++it_parent)
-            for (std::set<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
-                this->directParents_.erase(*it_parent_parent);
 
         // tell all parents that this identifier is a child
@@ -233,5 +237,5 @@
     bool Identifier::isA(const Identifier* identifier) const
     {
-        return (identifier == this || (this->parents_.find(identifier) != this->parents_.end()));
+        return (identifier == this || (this->isChildOf(identifier)));
     }
 
Index: /code/branches/core7/src/libraries/core/class/Identifier.h
===================================================================
--- /code/branches/core7/src/libraries/core/class/Identifier.h	(revision 10370)
+++ /code/branches/core7/src/libraries/core/class/Identifier.h	(revision 10371)
@@ -149,5 +149,4 @@
 
             void initializeParents(const std::set<const Identifier*>& initializationTrace);
-            void initializeDirectParentsOfAbstractClass();
             void finishInitialization();
 
Index: /code/branches/core7/src/libraries/core/class/IdentifierManager.cc
===================================================================
--- /code/branches/core7/src/libraries/core/class/IdentifierManager.cc	(revision 10370)
+++ /code/branches/core7/src/libraries/core/class/IdentifierManager.cc	(revision 10371)
@@ -133,6 +133,4 @@
                     delete temp;
                 }
-                else
-                    it->second->initializeDirectParentsOfAbstractClass();
 
                 initializedIdentifiers.insert(it->second);
