Improved get_max_cell_size. Issue with getting corners.