Support committing to disk and fix a bug visible on Windows