A few fixes to build on Windows

Yes, I know it's not a nice solution. But a solution it is nonetheless, and I think having everything building on Windows is a good idea.