Fix failure handling in EventDispatcher

@andreasohlund @gbiellem can you review?