Some minor fixups so it builds on Mingw