fixes to remove parent IDs and to fix off by one error in xrefs