Index: /applications/editors/josm/plugins/tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java
===================================================================
--- /applications/editors/josm/plugins/tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java	(revision 19984)
+++ /applications/editors/josm/plugins/tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java	(revision 19985)
@@ -143,4 +143,9 @@
                 continue;
             }
+
+            if(m.get(ww) != null){
+                ww = m.get(ww);
+            }
+
             for (Pair<Node, Node> np : ww.getNodePairs(false)) {
                 double dist = TracerGeometry.distanceFromSegment(ll, np.a.getCoor(), np.b.getCoor());
@@ -155,9 +160,4 @@
         if (minDist < MIN_DISTANCE_TW) {
             Way newNWay = new Way(nearestWay);
-
-            if(m.get(nearestWay) != null){
-                newNWay = m.get(nearestWay);
-                m.remove(nearestWay);
-            }
 
             newNWay.addNode(nearestNodeIndex + 1, node);
