Fix the event dispatcher bug.