fixes to make work with Windows

fixes to make work for Windows thanks to Doug