Some MinGW compatibility fixes