Another alternative tho a pretty lengthy one depending on the amount of vertices you needed merged would be to select two vertices at a time and use weld instead of merge. Will take longer but you wont have to worry about merging vertices you dont want together.