Fixes to work on Windows, sync fixes