Handle multidimensioned arrays properly