Fixed bug when assigning workers to tasks.