Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 26834)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 26835)
@@ -140,14 +140,21 @@
     public boolean loadCache(File file, int currentLambertZone) {
         boolean successfulRead = false;
-        try {
-            FileInputStream fis = new FileInputStream(file);
-            ObjectInputStream ois = new ObjectInputStream(fis);
+        FileInputStream fis = null;
+        ObjectInputStream ois = null;
+        try {
+            fis = new FileInputStream(file);
+            ois = new ObjectInputStream(fis);
             successfulRead = wmsLayer.read(ois, currentLambertZone);
-            ois.close();
-            fis.close();
         } catch (Exception ex) {
             ex.printStackTrace(System.out);
             JOptionPane.showMessageDialog(Main.parent, tr("Error loading file.\nProbably an old version of the cache file."), tr("Error"), JOptionPane.ERROR_MESSAGE);
             return false;
+        } finally {
+            try {
+                ois.close();
+                fis.close();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
         if (successfulRead && wmsLayer.isRaster()) {
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 26834)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 26835)
@@ -36,5 +36,5 @@
             else
                 imageModified = new VectorImageModifier(img, false);
-            return new GeorefImage(imageModified.bufferedImage, lambertMin, lambertMax);
+            return new GeorefImage(imageModified.bufferedImage, lambertMin, lambertMax, wmsLayer);
         } catch (MalformedURLException e) {
             throw (IOException) new IOException(tr("CadastreGrabber: Illegal url.")).initCause(e);
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 26834)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 26835)
@@ -29,7 +29,4 @@
     public EastNorth min;
     public EastNorth max;
-    // offset for vector images temporarily shifted (correcting Cadastre artifacts), in pixels
-    public double deltaEast=0;
-    public double deltaNorth=0;
     // bbox of the georeferenced original image (raster only) (inclined if rotated and before cropping)
     // P[0] is bottom,left then next are clockwise.
@@ -43,9 +40,11 @@
 
     public BufferedImage image;
+    public WMSLayer wmsLayer;
 
     private double pixelPerEast;
     private double pixelPerNorth;
-
-    public GeorefImage(BufferedImage img, EastNorth min, EastNorth max) {
+    
+
+    public GeorefImage(BufferedImage img, EastNorth min, EastNorth max, WMSLayer wmsLayer) {
         image = img;
  
@@ -63,4 +62,5 @@
         this.imageOriginalHeight = (img == null ? 1 : img.getHeight());
         this.imageOriginalWidth = (img == null ? 1 : img.getWidth());
+        this.wmsLayer = wmsLayer;
         updatePixelPer();
     }
@@ -111,6 +111,11 @@
 
         // apply offsets defined manually when vector images are translated manually (not saved in cache)
-        Point minPt = nc.getPoint(new EastNorth(min.east()+deltaEast, min.north()+deltaNorth));
-        Point maxPt = nc.getPoint(new EastNorth(max.east()+deltaEast, max.north()+deltaNorth));
+        double dx=0, dy=0;
+        if (wmsLayer!=null) {
+            dx = wmsLayer.deltaEast;
+            dy = wmsLayer.deltaNorth;
+        }
+        Point minPt = nc.getPoint(new EastNorth(min.east()+dx, min.north()+dy));
+        Point maxPt = nc.getPoint(new EastNorth(max.east()+dx, max.north()+dy));
 
         if (!g.hitClip(minPt.x, maxPt.y, maxPt.x - minPt.x, minPt.y - maxPt.y))
@@ -127,5 +132,6 @@
                 Point[] croppedPoint = new Point[5];
                 for (int i=0; i<4; i++)
-                    croppedPoint[i] = nc.getPoint(orgCroppedRaster[i]);
+                    croppedPoint[i] = nc.getPoint(
+                            new EastNorth(orgCroppedRaster[i].east()+dx, orgCroppedRaster[i].north()+dy));
                 croppedPoint[4] = croppedPoint[0];
                 for (int i=0; i<4; i++) {
@@ -369,12 +375,3 @@
     }
 
-    /**
-     * Add a temporary translation (dx, dy) to this image (for vector images only)
-     * @param dx delta added to X image coordinate
-     * @param dy delta added to Y image coordinate
-     */
-    public void tempShear(double dx, double dy) {
-        this.deltaEast+=dx;
-        this.deltaNorth+=dy;
-    }
 }
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 26834)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 26835)
@@ -85,4 +85,8 @@
     private double rasterRatio;
 
+    // offset for vector images temporarily shifted (correcting Cadastre artifacts), in pixels
+    public double deltaEast=0;
+    public double deltaNorth=0;
+
     private Action saveAsPng;
 
@@ -91,15 +95,11 @@
     @SuppressWarnings("serial")
     class ResetOffsetActionMenu extends JosmAction {
-        private WMSLayer wmsLayer;
-        public ResetOffsetActionMenu(WMSLayer wmsLayer) {
+        public ResetOffsetActionMenu() {
             super(tr("Reset offset"), null, tr("Reset offset (only vector images)"), null, false);
-            this.wmsLayer = wmsLayer;
         }
         @Override
         public void actionPerformed(ActionEvent arg0) {
-            for (GeorefImage img:wmsLayer.images) {
-                img.deltaEast = 0;
-                img.deltaNorth = 0;
-            }
+            deltaEast = 0;
+            deltaNorth = 0;
             Main.map.mapView.repaint();
         }
@@ -180,6 +180,6 @@
         EastNorth lambertMin = Main.getProjection().latlon2eastNorth(b.getMin());
         EastNorth lambertMax = Main.getProjection().latlon2eastNorth(b.getMax());
-        double minEast = lambertMin.east();
-        double minNorth = lambertMin.north();
+        double minEast = lambertMin.east()+deltaEast;
+        double minNorth = lambertMin.north()+deltaNorth;
         double dEast = (lambertMax.east() - minEast) / factor;
         double dNorth = (lambertMax.north() - minNorth) / factor;
@@ -309,6 +309,6 @@
         cancelGrab = new MenuActionCancelGrab(this);
         cancelGrab.setEnabled(!isRaster && grabThread.getImagesToGrabSize() > 0);
-        Action resetOffset = new ResetOffsetActionMenu(this);
-        resetOffset.setEnabled(!isRaster && images.size() > 0 && (images.get(0).deltaEast!=0.0 || images.get(0).deltaNorth!=0.0));
+        Action resetOffset = new ResetOffsetActionMenu();
+        resetOffset.setEnabled(!isRaster && images.size() > 0 && (deltaEast!=0.0 || deltaNorth!=0.0));
         return new Action[] {
                 LayerListDialog.getInstance().createShowHideLayerAction(),
@@ -338,5 +338,5 @@
             new GeorefImage(null,
             Main.getProjection().latlon2eastNorth(bounds.getMin()),
-            Main.getProjection().latlon2eastNorth(bounds.getMax()));
+            Main.getProjection().latlon2eastNorth(bounds.getMax()), this);
         for (GeorefImage img : images) {
             if (img.overlap(georefImage))
@@ -509,4 +509,5 @@
                         }
                     }
+                    newImage.wmsLayer = this;
                     this.images.add(newImage);
                 }
@@ -550,5 +551,5 @@
             synchronized(this) {
                 images.clear();
-                images.add(new GeorefImage(new_img, min, max));
+                images.add(new GeorefImage(new_img, min, max, this));
             }
         }
@@ -626,6 +627,6 @@
             images.get(0).shear(dx, dy);
         } else {
-            for (GeorefImage image:images)
-                image.tempShear(dx, dy);
+            deltaEast+=dx;
+            deltaNorth+=dy;
         }
     }
