Fixed a bug with adding nodes that overlap in both directions