Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 18271)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 18278)
@@ -12,5 +12,4 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.image.BufferedImage;
 import java.io.*;
 import java.util.ArrayList;
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 18271)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 18278)
@@ -76,5 +76,5 @@
  *                 - fixed bug of raster image loaded from cache not working on Java1.6
  *                 - improve mouse click bounce detection during georeferencing process
- * 1.4 23-Oct-2009 - add support for new Lambert CC 9 Zones projection
+ * 1.4 25-Oct-2009 - add support for new Lambert CC 9 Zones projection
  *                 - add optional crosspieces display on raster image layers
  *                 - add automatic raster images georeferencing when WMS provides data
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 18271)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 18278)
@@ -4,5 +4,4 @@
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.concurrent.Future;
 
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 18271)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 18278)
@@ -7,5 +7,4 @@
 import java.util.ArrayList;
 
-import javax.swing.JComboBox;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
@@ -50,5 +49,4 @@
             inputTown.setToolTipText(tr("<html>Enter the town,village or city name.<br>"
                     + "Use the syntax and punctuation known by www.cadastre.gouv.fr .</html>"));
-            JComboBox inputWMSList = null;
 
             p.add(labelSectionNewLocation, GBC.eol());
@@ -88,6 +86,6 @@
                 Main.main.addLayer(wmsLayer);
                 System.out.println("Add new layer with Location:" + inputTown.getText());
-            } else if (existingLayers != null && existingLayers.size() > 0 && inputWMSList.getSelectedIndex() > 0) {
-                wmsLayer = existingLayers.get(inputWMSList.getSelectedIndex()-1);
+            } else if (existingLayers != null && existingLayers.size() > 0 && Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
+                wmsLayer = (WMSLayer)Main.map.mapView.getActiveLayer();
                 resetCookie = true;
             }
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java	(revision 18271)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java	(revision 18278)
@@ -5,7 +5,5 @@
 import java.awt.event.ActionEvent;
 import java.awt.image.BufferedImage;
-import java.io.BufferedOutputStream;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 
@@ -16,7 +14,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-
-import com.sun.image.codec.jpeg.JPEGCodec;
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
 
 public class MenuActionSaveRasterAs extends JosmAction {
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 18271)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 18278)
@@ -38,11 +38,24 @@
     @Override public void enterMode() {
         if (Main.map != null) {
+            selectedLayer = null;
+            WMSLayer possibleLayer = null;
+            int cRasterLayers = 0;
+            for (Layer l : Main.map.mapView.getAllLayers()) {
+                if (l instanceof WMSLayer && ((WMSLayer)l).isRaster()) {
+                    possibleLayer = (WMSLayer)l;
+                    cRasterLayers++;
+                }
+            }
             Layer activeLayer = Main.map.mapView.getActiveLayer();
             if (activeLayer instanceof WMSLayer && ((WMSLayer)activeLayer).isRaster()) {
+                selectedLayer = (WMSLayer)activeLayer;
+            } else if (cRasterLayers == 1) {
+                selectedLayer = possibleLayer;
+            }
+            if (selectedLayer != null) {
                 super.enterMode();
                 Main.map.mapView.addMouseListener(this);
                 Main.map.mapView.addMouseMotionListener(this);
                 rasterMoved = false;
-                selectedLayer = (WMSLayer)activeLayer;
             } else {
                 JOptionPane.showMessageDialog(Main.parent,tr("This mode works only if active layer is\n"
