Replaced array2d (deprecated) with check_array.