Mark items as complete rather than completely removing them from the activeTasks list. This allows time accounting to work.
Don't reduce numActiveTasks unless task changes from active to completed