Fixed bug with multi-dimensional arrays