Fixing build and test process on Windows

Closes #2006
Agreed. Fixed and pushed.