TRQ-2396. Fix a problem with setting states for heterogenous jobs.