Fix exception from executing targetedcommand on a task deleted from tasks.txt