Fix bug when object has unsaved changes immediately after creation