Fixes various engine bugs.