Fixes for MinGW