Fixed some event management issues