Fix internal link rewrite bug in conref processing #1684