Fixes to task status logic