Fixing security and table-building bug.