Fixed engine bugs.