Fix MinGW compilation errors