Improved get_table_fields