Fixing errors when deleting events