fixed minor bugs for export_table and import_table scripts