mingw stuff

Fixes some compiling errors i ran into when using mingw