Windows Fixes

See commit messages.