Fixed compilation issues on mingw.