Fixed bug "crash when trying to add an event".