Fix syntax error in previous commit

undefined method `with_index' for .. Array
@tboerger I suggested something similar before already, but Jiri preferred to do the code that way.