Index: code/branches/objecthierarchy/src/core/BaseObject.cc
===================================================================
--- code/branches/objecthierarchy/src/core/BaseObject.cc	(revision 2066)
+++ code/branches/objecthierarchy/src/core/BaseObject.cc	(revision 2069)
@@ -217,5 +217,5 @@
     EventContainer* BaseObject::getEventContainer(const std::string& sectionname) const
     {
-        std::map<std::string, EventContainer*>::const_iterator it = this->eventContainers_.begin();
+        std::map<std::string, EventContainer*>::const_iterator it = this->eventContainers_.find(sectionname);
         if (it != this->eventContainers_.end())
             return ((*it).second);
Index: code/branches/objecthierarchy/src/core/Event.cc
===================================================================
--- code/branches/objecthierarchy/src/core/Event.cc	(revision 2066)
+++ code/branches/objecthierarchy/src/core/Event.cc	(revision 2069)
@@ -38,5 +38,5 @@
     }
 
-    void EventContainer::process(BaseObject* object, const Event& event)
+    void EventContainer::process(void* object, const Event& event)
     {
         if (this->eventname_ == event.sectionname_)
@@ -47,14 +47,19 @@
                     ++this->activeEvents_;
                 else
+                {
                     --this->activeEvents_;
 
+                    if (this->activeEvents_ < 0)
+                        this->activeEvents_ = 0;
+                }
+
                 if (this->eventfunction_->getParamCount() == 0 && event.activate_)
-                    (*this->eventfunction_)(object);
+                    (*this->eventfunction_)();
                 else if ((this->activeEvents_ == 1 && event.activate_) || (this->activeEvents_ == 0 && !event.activate_))
                 {
                     if (this->eventfunction_->getParamCount() == 1)
-                        (*this->eventfunction_)(object, this->activeEvents_);
+                        (*this->eventfunction_)(this->activeEvents_);
                     else if (this->eventfunction_->getParamCount() >= 2 && event.castedOriginator_)
-                        (*this->eventfunction_)(object, this->activeEvents_, event.castedOriginator_);
+                        (*this->eventfunction_)(this->activeEvents_, event.castedOriginator_);
                 }
             }
Index: code/branches/objecthierarchy/src/core/Event.h
===================================================================
--- code/branches/objecthierarchy/src/core/Event.h	(revision 2066)
+++ code/branches/objecthierarchy/src/core/Event.h	(revision 2069)
@@ -48,7 +48,7 @@
         public:
             EventContainer(const std::string& eventname, Executor* eventfunction, Identifier* subclass) : eventname_(eventname), eventfunction_(eventfunction), subclass_(subclass), activeEvents_(0) {}
-            ~EventContainer();
+            virtual ~EventContainer();
 
-            void process(BaseObject* object, const Event& event);
+            virtual void process(void* object, const Event& event);
 
         private:
@@ -59,4 +59,20 @@
             int activeEvents_;
     };
+
+    template <class T>
+    class ClassEventContainer : public EventContainer
+    {
+        public:
+            ClassEventContainer(const std::string& eventname, ExecutorMember<T>* eventfunction, Identifier* subclass) : EventContainer(eventname, (Executor*)eventfunction, subclass), eventfunction_(eventfunction) {}
+
+            void process(void* object, const Event& event)
+            {
+                this->eventfunction_->setObject((T*)object);
+                EventContainer::process(object, event);
+            }
+
+        private:
+            ExecutorMember<T>* eventfunction_;
+    };
 }
 
Index: code/branches/objecthierarchy/src/core/EventIncludes.h
===================================================================
--- code/branches/objecthierarchy/src/core/EventIncludes.h	(revision 2066)
+++ code/branches/objecthierarchy/src/core/EventIncludes.h	(revision 2069)
@@ -49,5 +49,5 @@
     if (!containername) \
     { \
-        containername = new orxonox::EventContainer(std::string(eventname), executor, orxonox::ClassIdentifier<subclassname>::getIdentifier()); \
+        containername = new orxonox::ClassEventContainer<classname>(std::string(eventname), executor, orxonox::ClassIdentifier<subclassname>::getIdentifier()); \
         this->addEventContainer(eventname, containername); \
     } \
