Fixed bug in Engine