Fix autosave file indices

Reset index when file saved or opened