Misc. engine fixes to stabilize the build