MinGW portability fixes # 1