This fixes changes made in commit d4d51de7 Which fails for a job state of Pending (needed to special case the zero value).