Also fixes one bug that was found when an async function throws an error after being scheduled on a task.