Fixes for Windows build