Index: /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/ModelContainer.java
===================================================================
--- /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/ModelContainer.java	(revision 26287)
+++ /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/ModelContainer.java	(revision 26288)
@@ -20,6 +20,6 @@
 
 public class ModelContainer {
-    private static final ModelContainer EMPTY = new ModelContainer(Collections.<Node> emptySet(), Collections
-            .<Way> emptySet(), false);
+    private static final ModelContainer EMPTY = new ModelContainer(Collections.<Node> emptySet(),
+            Collections.<Way> emptySet(), false);
     
     public static ModelContainer create(Iterable<Node> primaryNodes, Iterable<Way> primaryWays) {
@@ -46,17 +46,16 @@
                 for (Way w : Utils.filterRoads(n.getReferrers())) {
                     if (w.isFirstLastNode(n)) {
-                        closed &= close(closedNodes, closedWays, w, Constants.TURN_ROLE_FROM);
-                        closed &= close(closedNodes, closedWays, w, Constants.TURN_ROLE_TO);
+                        closed &= close(closedNodes, closedWays, w);
                     }
                 }
                 
                 for (Way w : new ArrayList<Way>(closedWays)) {
-                    closed &= close(closedNodes, closedWays, w, Constants.TURN_ROLE_VIA);
-                }
-            }
-        }
-    }
-    
-    private static boolean close(Set<Node> closedNodes, Set<Way> closedWays, Way w, String role) {
+                    closed &= close(closedNodes, closedWays, w);
+                }
+            }
+        }
+    }
+    
+    private static boolean close(Set<Node> closedNodes, Set<Way> closedWays, Way w) {
         boolean closed = true;
         
@@ -67,5 +66,5 @@
             
             for (RelationMember m : r.getMembers()) {
-                if (m.getRole().equals(role) && m.getMember().equals(w)) {
+                if (m.getRole().equals(Constants.TURN_ROLE_VIA) && m.getMember().equals(w)) {
                     closed &= close(closedNodes, closedWays, r);
                 }
@@ -297,3 +296,11 @@
         return empty;
     }
+    
+    public boolean hasRoad(Way w) {
+        return roads.containsKey(w);
+    }
+    
+    public boolean hasJunction(Node n) {
+        return junctions.containsKey(n);
+    }
 }
Index: /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Turn.java
===================================================================
--- /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Turn.java	(revision 26287)
+++ /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Turn.java	(revision 26288)
@@ -56,4 +56,8 @@
         final Way to = Utils.getMemberWay(r, Constants.TURN_ROLE_TO);
         
+        if (!c.hasRoad(from) || !c.hasRoad(to)) {
+            return Collections.emptySet();
+        }
+        
         final List<Way> tmp = Utils.getMemberWays(r, Constants.TURN_ROLE_VIA);
         final LinkedList<Road> via = new LinkedList<Road>();
@@ -65,4 +69,8 @@
         while (it.hasNext()) {
             final Way w = it.next();
+            if (!c.hasRoad(w)) {
+                return Collections.emptySet();
+            }
+            
             final Road v = c.getRoad(w);
             via.add(v);
@@ -119,4 +127,8 @@
         final Way to = Utils.getMemberWay(r, Constants.TURN_ROLE_TO);
         
+        if (!c.hasRoad(from) || !c.hasJunction(via) || !c.hasRoad(to)) {
+            return Collections.emptySet();
+        }
+        
         final Junction j = c.getJunction(via);
         
@@ -126,7 +138,5 @@
         final Set<Turn> result = new HashSet<Turn>();
         for (int i : indices(r, Constants.TURN_KEY_LANES)) {
-            result
-                    .add(new Turn(r, fromRoadEnd.getLane(Lane.Kind.REGULAR, i), Collections.<Road> emptyList(),
-                            toRoadEnd));
+            result.add(new Turn(r, fromRoadEnd.getLane(Lane.Kind.REGULAR, i), Collections.<Road> emptyList(), toRoadEnd));
         }
         for (int i : indices(r, Constants.TURN_KEY_EXTRA_LANES)) {
Index: /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java
===================================================================
--- /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java	(revision 26287)
+++ /applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java	(revision 26288)
@@ -109,6 +109,9 @@
         
         for (Relation r : OsmPrimitive.getFilteredList(dataSet.allPrimitives(), Relation.class)) {
+            if (!r.isUsable()) {
+                continue;
+            }
+            
             final String type = r.get("type");
-            
             if (Constants.TYPE_LENGTHS.equals(type)) {
                 lenghts.add(r);
@@ -127,5 +130,5 @@
             if (lanes.unreferenced() > 0) {
                 issues.add(Issue.newWarning(Arrays.asList(lanes.key.junction, lanes.key.from),
-                    tr("{0} lanes are not referenced in any turn-relation.", lanes.unreferenced())));
+                        tr("{0} lanes are not referenced in any turn-relation.", lanes.unreferenced())));
             }
         }
@@ -172,5 +175,5 @@
             if (tooLong > 0) {
                 issues.add(Issue.newError(r, end, "The lengths-relation specifies " + tooLong
-                    + " extra-lanes which are longer than its ways."));
+                        + " extra-lanes which are longer than its ways."));
             }
             
@@ -186,5 +189,5 @@
     
     private void putIncomingLanes(Route route, List<Double> left, List<Double> right,
-        Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
+            Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
         final Node end = route.getLastSegment().getEnd();
         final Way way = route.getLastSegment().getWay();
@@ -196,31 +199,8 @@
         if (old != null) {
             incomingLanes.put(
-                key,
-                new IncomingLanes(key, Math.max(lanes.extraLeft, old.extraLeft), Math.max(lanes.regular, old.regular), Math
-                    .max(lanes.extraRight, old.extraRight)));
-        }
-        
-        // TODO this tends to produce a bunch of useless errors
-        // turn lanes really should not span from one junction past another, remove??
-        //      final double length = route.getLastSegment().getLength();
-        //      final List<Double> newLeft = reduceLengths(left, length);
-        //      final List<Double> newRight = new ArrayList<Double>(right.size());
-        //      
-        //      if (route.getSegments().size() > 1) {
-        //          final Route subroute = route.subRoute(0, route.getSegments().size() - 1);
-        //          putIncomingLanes(subroute, newLeft, newRight, incomingLanes);
-        //      }
-    }
-    
-    private List<Double> reduceLengths(List<Double> lengths, double length) {
-        final List<Double> newLengths = new ArrayList<Double>(lengths.size());
-        
-        for (double l : lengths) {
-            if (l > length) {
-                newLengths.add(l - length);
-            }
-        }
-        
-        return newLengths;
+                    key,
+                    new IncomingLanes(key, Math.max(lanes.extraLeft, old.extraLeft), Math.max(lanes.regular,
+                            old.regular), Math.max(lanes.extraRight, old.extraRight)));
+        }
     }
     
@@ -230,5 +210,5 @@
         if (ways.isEmpty()) {
             issues.add(Issue.newError(r, "A lengths-relation requires at least one member-way with role \""
-                + Constants.LENGTHS_ROLE_WAYS + "\"."));
+                    + Constants.LENGTHS_ROLE_WAYS + "\"."));
             return null;
         }
@@ -255,5 +235,5 @@
             if (!ends.add(current)) {
                 issues.add(Issue.newError(r, ways, "The " + role + " of the " + type
-                    + "-relation are unordered (and contain cycles)."));
+                        + "-relation are unordered (and contain cycles)."));
                 return null;
             }
