multiple changes to support Windows build. Linux build temporary broken