Fix a bug when deleting an object.