Fix issue with array dimensions