Fix compile problems for mingw compiler.