Added missing call to setDirty after saving to file