Fixed polymorphism issues in behaviour tree