Fix mingw compilation issues