Fix KeyError when there are no jobs