Fix the ReferencePosition comparator