Fixing bug with task states
Fixing tests