Fix mingw compiler errors