Fix autosave corruption bug