Fixed game engine bugs