Fix mingw64 incompatibility

There is a lot of warnings yet, so some work should be done.