Fixed jobs_helper

to correctly determine whether jobs are finished.