fix xref bugs.