Build fixes for MINGW32