Fixes for mingw32