Fix jobs enumaration in new code, otherwise program loops infinitly.