Building on Windows

Fixes to enable building on Windows.