Add xref target and fix uncovered bug