Fixes for building on Windows with msys.