Merge pull request #500 from peternewman/windows

Fix some issues on Windows
Merge pull request #501 from peternewman/windows

More Windows fixes