Bugfix in GetNextTask - forgot to set task on exit.