Fix compile problems on windows with mingw

It now compiles cleanly