Some random fixes for the mingw build.

Still doesn't build but were closer.