Fixing Table::buildTable() infinite loop

There is an infinite loop somewhere in Table::buildTable(). I am trying to
fix it.