Partial solution to the pending_xref problem