Windows save fix

Only the required changes to fix save/load on Windows are in this branch.