Fixes for building with __MINGW32_VERSION 2.1