Fixed some editor bugs regarding event handlers