fix bugs for schema-export