Made specialnames global.
Made merges loop until no change.
Fixed bug in single path merge related to two-node loops.