Fixed a bug with node placement after merge

If the user attempted to merge two branches of uneven length, the
resulting merge node was placed incorrectly.