Fix bug #2496 with column counting in presence of display tables.