Fixes to build on Windows