Bugfix in engine