fix errors and warnings with mingw