Index: trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 6868)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 6869)
@@ -13,5 +13,6 @@
 import java.util.Set;
 
-import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -33,5 +34,5 @@
 public abstract class CrossingWays extends Test {
     protected static final int CROSSING_WAYS = 601;
-    
+
     private static final String HIGHWAY = "highway";
     private static final String RAILWAY = "railway";
@@ -227,5 +228,11 @@
         for (int i = 0; i < nodesSize - 1; i++) {
             final WaySegment es1 = new WaySegment(w, i);
-            for (List<WaySegment> segments : getSegments(es1.getFirstNode(), es1.getSecondNode())) {
+            final EastNorth en1 = es1.getFirstNode().getEastNorth();
+            final EastNorth en2 = es1.getSecondNode().getEastNorth();
+            if (en1 == null || en2 == null) {
+                Main.warn("Crossing ways test skipped "+es1);
+                continue;
+            }
+            for (List<WaySegment> segments : getSegments(en1, en2)) {
                 for (WaySegment es2 : segments) {
                     List<Way> prims;
@@ -265,9 +272,9 @@
      * of segments already processed
      *
-     * @param n1 The first node
-     * @param n2 The second node
+     * @param n1 The first EastNorth
+     * @param n2 The second EastNorth
      * @return A list with all the cells the segment crosses
      */
-    public List<List<WaySegment>> getSegments(Node n1, Node n2) {
+    public List<List<WaySegment>> getSegments(EastNorth n1, EastNorth n2) {
 
         List<List<WaySegment>> cells = new ArrayList<List<WaySegment>>();
@@ -282,4 +289,3 @@
         return cells;
     }
-
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6868)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6869)
@@ -183,5 +183,5 @@
             }));
         }
-        
+
         private static void removeMetaRules(MapCSSStyleSource source) {
             for (Iterator<MapCSSRule> it = source.rules.iterator(); it.hasNext(); ) {
@@ -270,5 +270,9 @@
             while (m.find()) {
                 final String argument = determineArgument((Selector.GeneralSelector) matchingSelector, Integer.parseInt(m.group(1)), m.group(2));
-                m.appendReplacement(sb, String.valueOf(argument));
+                try {
+                    m.appendReplacement(sb, String.valueOf(argument));
+                } catch (IndexOutOfBoundsException e) {
+                    Main.error(tr("Unable to replace argument {0} in {1}: {2}", argument, sb, e.getMessage()));
+                }
             }
             m.appendTail(sb);
Index: trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java	(revision 6868)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java	(revision 6869)
@@ -10,7 +10,9 @@
 import java.util.Set;
 
+import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.validation.OsmValidator;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 
 /**
@@ -20,9 +22,9 @@
  */
 public final class ValUtil {
-    
+
     private ValUtil() {
         // Hide default constructor for utils classes
     }
-    
+
     /**
      * Returns the start and end cells of a way.
@@ -103,6 +105,5 @@
 
     /**
-     * Returns the coordinates of all cells in a grid that a line between 2
-     * nodes intersects with.
+     * Returns the coordinates of all cells in a grid that a line between 2 nodes intersects with.
      *
      * @param n1 The first node.
@@ -111,11 +112,31 @@
      * cells, but a bigger number of them.
      * @return A list with the coordinates of all cells
+     * @throws IllegalArgumentException if n1 or n2 is {@code null} or without coordinates
      */
-    public static List<Point2D> getSegmentCells(Node n1, Node n2, double gridDetail) {
+    public static List<Point2D> getSegmentCells(Node n1, Node n2, double gridDetail) throws IllegalArgumentException {
+        CheckParameterUtil.ensureParameterNotNull(n1, "n1");
+        CheckParameterUtil.ensureParameterNotNull(n1, "n2");
+        return getSegmentCells(n1.getEastNorth(), n2.getEastNorth(), gridDetail);
+    }
+
+    /**
+     * Returns the coordinates of all cells in a grid that a line between 2 nodes intersects with.
+     *
+     * @param en1 The first EastNorth.
+     * @param en2 The second EastNorth.
+     * @param gridDetail The detail of the grid. Bigger values give smaller
+     * cells, but a bigger number of them.
+     * @return A list with the coordinates of all cells
+     * @throws IllegalArgumentException if en1 or en2 is {@code null}
+     * @since 6869
+     */
+    public static List<Point2D> getSegmentCells(EastNorth en1, EastNorth en2, double gridDetail) throws IllegalArgumentException {
+        CheckParameterUtil.ensureParameterNotNull(en1, "en1");
+        CheckParameterUtil.ensureParameterNotNull(en2, "en2");
         List<Point2D> cells = new ArrayList<Point2D>();
-        double x0 = n1.getEastNorth().east() * gridDetail;
-        double x1 = n2.getEastNorth().east() * gridDetail;
-        double y0 = n1.getEastNorth().north() * gridDetail + 1;
-        double y1 = n2.getEastNorth().north() * gridDetail + 1;
+        double x0 = en1.east() * gridDetail;
+        double x1 = en2.east() * gridDetail;
+        double y0 = en1.north() * gridDetail + 1;
+        double y1 = en2.north() * gridDetail + 1;
 
         if (x0 > x1) {
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 6868)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 6869)
@@ -377,6 +377,6 @@
                         });
                     } catch (InterruptedException e) {
-                        // Occurs frequently during JOSM shutdown, log set to debug only
-                        Main.debug("InterruptedException in "+MapStatus.class.getSimpleName());
+                        // Occurs frequently during JOSM shutdown, log set to trace only
+                        Main.trace("InterruptedException in "+MapStatus.class.getSimpleName());
                     } catch (InvocationTargetException e) {
                         Main.warn(e);
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 6868)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 6869)
@@ -48,6 +48,6 @@
 
     /**
-     * who send th request?
-     * the host from refrerer header or IP of request sender
+     * who sent the request?
+     * the host from referer header or IP of request sender
      */
     protected String sender;
@@ -108,5 +108,5 @@
 
     abstract public String[] getMandatoryParams();
-    
+
     public String[] getOptionalParams() {
         return null;
@@ -242,5 +242,4 @@
                     + Utils.join(", ", missingKeys));
         }
-        
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 6868)
+++ trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 6869)
@@ -452,9 +452,12 @@
         boolean begin = true;
         for (Node n : polygon) {
-            if (begin) {
-                path.moveTo(n.getEastNorth().getX(), n.getEastNorth().getY());
-                begin = false;
-            } else {
-                path.lineTo(n.getEastNorth().getX(), n.getEastNorth().getY());
+            EastNorth en = n.getEastNorth();
+            if (en != null) {
+                if (begin) {
+                    path.moveTo(en.getX(), en.getY());
+                    begin = false;
+                } else {
+                    path.lineTo(en.getX(), en.getY());
+                }
             }
         }
