Fix bugs related to linked XY mating