Fix a bug with indexed ranges in n-D arrays