Fixes for MinGW-w64