Fix intra-document references