Bug fix around running task and returning result.