Minor changes to linkshape merge procedure