Bugfix for n-dimensional arrays