Added logic to extract a compact reference from a full reference.