Fix/schedule failed

Handling of the `schedule_failed` event mistakenly assumed that it was preceded by a `scheduled` event in the history. These changes remove this assumption.