Ensure table names are sorted