Fix compilation errors on MinGW