Fix termination when no work is being executed