Fixes error with 2D array creation, instead of creating min-max rows/cols, only the required number of rows/cols are created.