Build fixes for windows/mingw.