Fix import bugs for dump_cif and add test