Partially fix mingw build