Fix bugs that occur when saving a previously saved object.