Fixed bug related to selecting structures to merge