Index: code/branches/objecthierarchy/src/core/BaseObject.cc
===================================================================
--- code/branches/objecthierarchy/src/core/BaseObject.cc	(revision 2068)
+++ 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 2068)
+++ 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 2068)
+++ 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 2068)
+++ 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); \
     } \
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2068)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2069)
@@ -75,5 +75,5 @@
     void BlinkingBillboard::tick(float dt)
     {
-        if (Core::isMaster())
+        if (Core::isMaster() && this->isActive())
         {
             this->time_ += dt;
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc	(revision 2068)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc	(revision 2069)
@@ -54,5 +54,5 @@
 
     XMLPortParam(DistanceTrigger, "distance", setDistance, getDistance, xmlelement, mode).defaultValues(100.0f);
-    XMLPortParamLoadOnly(DistanceTrigger, "target", addTargets, xmlelement, mode);
+    XMLPortParamLoadOnly(DistanceTrigger, "target", addTargets, xmlelement, mode).defaultValues("ControllableEntity");
   }
 
@@ -81,8 +81,16 @@
   {
     Identifier* targetId = ClassByString(targets);
-    targetMask_.include(targetId);
+    if (!targetId)
+        return;
+
+    this->targetMask_.include(targetId);
+
     // trigger shouldn't react on itself or other triggers
-    targetMask_.exclude(Class(Trigger), true);
+    this->targetMask_.exclude(Class(Trigger), true);
 
+    // we only want WorldEntities
+    ClassTreeMask WEMask;
+    WEMask.include(Class(WorldEntity));
+    this->targetMask_ *= WEMask;
   }
 
@@ -90,19 +98,19 @@
   {
     Identifier* targetId = ClassByString(targets);
-    targetMask_.exclude(targetId);
+    this->targetMask_.exclude(targetId);
   }
 
   bool DistanceTrigger::checkDistance()
   {
-    // Iterate through all WorldEntities
-    for (Iterator<WorldEntity> it = ObjectList<WorldEntity>::begin(); it; ++it)
+    // Iterate through all objects
+    for (ClassTreeMaskObjectIterator it = this->targetMask_.begin(); it != this->targetMask_.end(); ++it)
     {
-      // check if WorldEntity is a target
-      if (targetMask_.isIncluded(it->getIdentifier()))
-      {
-        Vector3 distanceVec = it->getNode()->getWorldPosition() - this->getNode()->getWorldPosition();
-        if (distanceVec.length() < this->distance_)
-          return true;
-      }
+      WorldEntity* entity = dynamic_cast<WorldEntity*>(*it);
+      if (!entity)
+        continue;
+
+      Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition();
+      if (distanceVec.length() < this->distance_)
+        return true;
     }
     return false;
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2068)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2069)
@@ -50,4 +50,5 @@
     this->mode_ = TM_EventTriggerAND;
 
+    this->bFirstTick_ = true;
     this->bActive_ = false;
     this->bTriggered_ = false;
@@ -92,6 +93,11 @@
   void Trigger::tick(float dt)
   {
-
-    bool newTriggered = this->isTriggered();
+    if (this->bFirstTick_)
+    {
+      this->bFirstTick_ = false;
+      this->fireEvent(false);
+    }
+
+    bool newTriggered = this->isTriggered() ^ this->bInvertMode_;
 
     // check if new triggering event is really new
@@ -173,8 +179,5 @@
 //      this->bUpdating_ = false;
 
-      if (this->bInvertMode_)
-        return !returnval;
-      else
-        return returnval;
+      return returnval;
     }
     return true;
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.h	(revision 2068)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.h	(revision 2069)
@@ -35,4 +35,5 @@
 #include "OrxonoxPrereqs.h"
 
+#include "objects/Tickable.h"
 #include "objects/worldentities/PositionableEntity.h"
 #include "tools/BillboardSet.h"
@@ -47,5 +48,5 @@
   };
 
-  class _OrxonoxExport Trigger : public PositionableEntity
+  class _OrxonoxExport Trigger : public PositionableEntity, public Tickable
   {
     public:
@@ -111,4 +112,5 @@
       bool bActive_;
       bool bTriggered_;
+      bool bFirstTick_;
 
       TriggerMode mode_;
