Fix mingw compile issues