Fixes for building on MinGW GCC on Windows 7.