Fixed a task distribution bug.