mingw32 building fixes