Fixes for mingw32
More fixes for mingw.