Fixing a logic error in figuring out whether there is work to do.