Fixed Bugs when deleting events.