Bug fix for get_cell index overrun