Fixes for Windows

These commits fix up Windows so it will work better.