more cleanup in the task system