Fix build for mingw