Changes to engine, with fix to support Win8