[RMG] Fix mingw build, fix some warnings