Windows fixes

General fixes for MS Windows support.

[Closes #83]