Fixed some issues when creating/updating events.