Index: /code/branches/core6/src/libraries/core/object/ObjectList.h
===================================================================
--- /code/branches/core6/src/libraries/core/object/ObjectList.h	(revision 9603)
+++ /code/branches/core6/src/libraries/core/object/ObjectList.h	(revision 9604)
@@ -68,4 +68,10 @@
             typedef ObjectListIterator<T> iterator;
 
+            /// Returns the size of the list
+            inline static size_t size()
+            {
+                return ClassIdentifier<T>::getIdentifier()->getObjects()->size();
+            }
+
             /// Returns an Iterator to the first element in the list.
             inline static ObjectListElement<T>* begin()
Index: /code/branches/core6/src/libraries/core/object/ObjectListBase.cc
===================================================================
--- /code/branches/core6/src/libraries/core/object/ObjectListBase.cc	(revision 9603)
+++ /code/branches/core6/src/libraries/core/object/ObjectListBase.cc	(revision 9604)
@@ -43,5 +43,6 @@
     ObjectListBaseElement::~ObjectListBaseElement()
     {
-        this->list_->removeElement(this);
+        if (this->list_)
+            this->list_->removeElement(this);
     }
 
@@ -53,4 +54,5 @@
         this->first_ = 0;
         this->last_ = 0;
+        this->size_ = 0;
     }
 
@@ -60,11 +62,6 @@
     ObjectListBase::~ObjectListBase()
     {
-        ObjectListBaseElement* temp;
         while (this->first_)
-        {
-            temp = this->first_->next_;
             delete this->first_;
-            this->first_ = temp;
-        }
     }
 
@@ -86,9 +83,15 @@
     void ObjectListBase::addElement(ObjectListBaseElement* element)
     {
+        if (element->list_)
+        {
+            orxout(internal_error) << "Element is already registered in another list" << endl;
+            return;
+        }
+
         if (!this->last_)
         {
             // If the list is empty
             this->last_ = element;
-            this->first_ = this->last_; // There's only one object in the list now
+            this->first_ = element; // There's only one object in the list now
         }
         else
@@ -97,7 +100,10 @@
             ObjectListBaseElement* temp = this->last_;
             this->last_ = element;
-            this->last_->prev_ = temp;
-            temp->next_ = this->last_;
+            element->prev_ = temp;
+            temp->next_ = element;
         }
+
+        element->list_ = this;
+        ++this->size_;
     }
 
@@ -107,5 +113,12 @@
     void ObjectListBase::removeElement(ObjectListBaseElement* element)
     {
-        orxout(verbose, context::object_list) << "Removing Object from " << element->objectBase_->getIdentifier()->getName() << "-list." << endl;
+        if (element->list_ != this)
+        {
+            orxout(internal_error) << "Element is not registered in this list" << endl;
+            return;
+        }
+
+        if (element->objectBase_)
+            orxout(verbose, context::object_list) << "Removing Object from " << element->objectBase_->getIdentifier()->getName() << "-list." << endl;
         this->notifyRemovalListeners(element);
 
@@ -119,4 +132,9 @@
         else
             this->first_ = element->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list
+
+        element->list_ = 0;
+        element->next_ = 0;
+        element->prev_ = 0;
+        --this->size_;
     }
 }
Index: /code/branches/core6/src/libraries/core/object/ObjectListBase.h
===================================================================
--- /code/branches/core6/src/libraries/core/object/ObjectListBase.h	(revision 9603)
+++ /code/branches/core6/src/libraries/core/object/ObjectListBase.h	(revision 9604)
@@ -56,5 +56,5 @@
                 @param objectBase The object to store
             */
-            ObjectListBaseElement(Listable* object, ObjectListBase* list) : next_(0), prev_(0), objectBase_(object), list_(list) {}
+            ObjectListBaseElement(Listable* object) : next_(0), prev_(0), objectBase_(object), list_(0) {}
             ~ObjectListBaseElement();
 
@@ -74,5 +74,5 @@
     {
         public:
-            ObjectListElement(T* object, ObjectListBase* list) : ObjectListBaseElement(static_cast<Listable*>(object), list), object_(object) {}
+            ObjectListElement(T* object) : ObjectListBaseElement(static_cast<Listable*>(object)), object_(object) {}
             T* object_;              //!< The object
     };
@@ -113,5 +113,5 @@
             inline ObjectListBaseElement* add(T* object)
             {
-                ObjectListBaseElement* element = new ObjectListElement<T>(object, this);
+                ObjectListBaseElement* element = new ObjectListElement<T>(object);
                 this->addElement(element);
                 return element;
@@ -120,4 +120,6 @@
             void addElement(ObjectListBaseElement* element);
             void removeElement(ObjectListBaseElement* element);
+
+            size_t size() const { return this->size_; }
 
             /// Returns a pointer to the first element in the list. Works only with Iterator.
@@ -148,4 +150,5 @@
             ObjectListBaseElement* first_;                              //!< The first element in the list
             ObjectListBaseElement* last_;                               //!< The last element in the list
+            size_t size_;                                               //!< The number of elements in the list
             std::vector<ObjectListElementRemovalListener*> listeners_;  //!< A list of Iterators pointing on an element in this list
     };
Index: /code/branches/core6/src/libraries/core/object/ObjectListIterator.h
===================================================================
--- /code/branches/core6/src/libraries/core/object/ObjectListIterator.h	(revision 9603)
+++ /code/branches/core6/src/libraries/core/object/ObjectListIterator.h	(revision 9604)
@@ -70,7 +70,4 @@
     class ObjectListIterator : public IteratorBase<T, ObjectListIterator<T> >
     {
-        template <class I>
-        friend class Iterator;
-
         public:
             /**
