Update to make work on Windows

Includes only changes to make work on windows and only include those changes.