Fixes for MinGW and Linux build on windows branch

This is the same set of changes sent previously without the changes to the engine dialog