Fix syntax error in previous commit

undefined method `with_index' for .. Array
@tboerger As I commented on the previous PR, I share the opinion, but Jiri preferred to do the code that way.