Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 22188)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 22230)
@@ -89,5 +89,5 @@
     JLabel link = new JLabel();
     private Way selectedWay;
-    private Relation selectedRelation;
+    //private Relation selectedRelation;
     private boolean shift;
 
@@ -146,25 +146,12 @@
             } else {
                 // check if the node belongs to an associatedStreet relation
-                List<OsmPrimitive> l = currentMouseNode.getReferrers();
-                boolean nodeBelongsToRelation = false;
-                for (OsmPrimitive osm : l) {
-                    if (osm instanceof Relation && osm.hasKey("type") && osm.get("type").equals(relationAddrType)) {
-                        for (RelationMember rm : ((Relation)osm).getMembers()) {
-                            if (rm.getRole().equals(relationAddrStreetRole)) {
-                                OsmPrimitive osp = rm.getMember();
-                                if (osp instanceof Way && osp.hasKey(tagHighwayName)) {
-                                    inputStreet.setText(osp.get(tagHighwayName));
-                                    setSelectedWay((Way)osp, (Relation)osm);
-                                    nodeBelongsToRelation = true;
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                }
-                if (!nodeBelongsToRelation) {
+                Way wayInRelationAddr = findWayInRelationAddr(currentMouseNode);
+                if (wayInRelationAddr == null) {
                     // node exists but doesn't carry address information : add tags like a new node
                     Collection<Command> cmds = new LinkedList<Command>();
                     addAddrToPrimitive(currentMouseNode, cmds);
+                } else {
+                    inputStreet.setText(wayInRelationAddr.get(tagHighwayName));
+                    setSelectedWay(wayInRelationAddr);
                 }
             }
@@ -201,4 +188,21 @@
     }
     
+    private Way findWayInRelationAddr(Node n) {
+        List<OsmPrimitive> l = n.getReferrers();
+        for (OsmPrimitive osm : l) {
+            if (osm instanceof Relation && osm.hasKey("type") && osm.get("type").equals(relationAddrType)) {
+                for (RelationMember rm : ((Relation)osm).getMembers()) {
+                    if (rm.getRole().equals(relationAddrStreetRole)) {
+                        OsmPrimitive osp = rm.getMember();
+                        if (osp instanceof Way && osp.hasKey(tagHighwayName)) {
+                            return (Way)osp;
+                        }
+                    }
+                }
+            }
+        }
+        return null;
+    }
+    
     private void addAddrToPolygon(List<Way> mouseOnExistingBuildingWays, Collection<Command> cmds) {
         for (Way w:mouseOnExistingBuildingWays) {
@@ -221,19 +225,20 @@
             cmds.add(new ChangePropertyCommand(osm, tagHouseStreet, inputStreet.getText()));
         } else if (selectedWay != null) {
-           // add the node to its relation
-           if (selectedRelation != null) {
-               RelationMember rm = new RelationMember(relationMemberHouse, osm);
-               Relation newRel = new Relation(selectedRelation);
-               newRel.addMember(rm);
-               cmds.add(new ChangeCommand(selectedRelation, newRel));
-           } else {
-               // create new relation
-               Relation newRel = new Relation();
-               newRel.put("type", relationAddrType);
-               newRel.put(relationAddrName, selectedWay.get(tagHighwayName));
-               newRel.addMember(new RelationMember(relationAddrStreetRole, selectedWay));
-               newRel.addMember(new RelationMember(relationMemberHouse, osm));
-               cmds.add(new AddCommand(newRel));
-           }
+            Relation selectedRelation = findRelationAddr(selectedWay);
+            // add the node to its relation
+            if (selectedRelation != null) {
+                RelationMember rm = new RelationMember(relationMemberHouse, osm);
+                Relation newRel = new Relation(selectedRelation);
+                newRel.addMember(rm);
+                cmds.add(new ChangeCommand(selectedRelation, newRel));
+            } else {
+                // create new relation
+                Relation newRel = new Relation();
+                newRel.put("type", relationAddrType);
+                newRel.put(relationAddrName, selectedWay.get(tagHighwayName));
+                newRel.addMember(new RelationMember(relationAddrStreetRole, selectedWay));
+                newRel.addMember(new RelationMember(relationMemberHouse, osm));
+                cmds.add(new AddCommand(newRel));
+            }
         }
         try {
@@ -245,4 +250,14 @@
             System.out.println("Unable to parse house number \"" + inputNumber.getText() + "\"");
         }
+    }
+    
+    private Relation findRelationAddr(Way w) {
+        List<OsmPrimitive> l = w.getReferrers();
+        for (OsmPrimitive osm : l) {
+            if (osm instanceof Relation && osm.hasKey("type") && osm.get("type").equals(relationAddrType)) {
+                return (Relation)osm;
+            }
+        }
+        return null;
     }
     
@@ -480,14 +495,8 @@
     private void setSelectedWay(Way w) {
         this.selectedWay = w;
-        this.selectedRelation = null;
         if (w == null) {
             link.setEnabled(false);
         } else
             link.setEnabled(true);
-    }
-    
-    private void setSelectedWay(Way w, Relation r) {
-        setSelectedWay(w);
-        this.selectedRelation = r;
     }
     
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 22188)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 22230)
@@ -43,5 +43,5 @@
     private JCheckBox autoFirstLayer = new JCheckBox(tr("Select first WMS layer in list."));
     
-    private JCheckBox dontUseRelation = new JCheckBox(tr("Don't use relation for addresses (but \"addr:street\" on nodes)."));
+    private JCheckBox dontUseRelation = new JCheckBox(tr("Don't use relation for addresses (but \"addr:street\" on elements)."));
     
     private JRadioButton grabMultiplier1 = new JRadioButton("", true);
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 22188)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 22230)
@@ -57,6 +57,7 @@
         this.orgCroppedRaster[2] = max;
         this.orgCroppedRaster[3] = new EastNorth(max.east(), min.north());
-        this.imageOriginalHeight = img.getHeight();
-        this.imageOriginalWidth = img.getWidth();
+        // img can be null for a hack used in overlapping detection
+        this.imageOriginalHeight = (img == null ? 1 : img.getHeight());
+        this.imageOriginalWidth = (img == null ? 1 : img.getWidth());
         updatePixelPer();
     }
