Added tracking of task mode to results and tasks.