Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java	(revision 32484)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java	(revision 32485)
@@ -150,6 +150,6 @@
                 Main.map.selectZoomTool(false); // Select tool might not be support of active layer, zoom is always supported
             }
-            Main.main.addLayer(new GpxLayer(toGpxData(false), tr("Converted from: {0}", getName())));
-            Main.main.removeLayer(EditGpxLayer.this);
+            Main.getLayerManager().addLayer(new GpxLayer(toGpxData(false), tr("Converted from: {0}", getName())));
+            Main.getLayerManager().removeLayer(EditGpxLayer.this);
         }
     }
@@ -170,6 +170,6 @@
                 Main.map.selectZoomTool(false); // Select tool might not be support of active layer, zoom is always supported
             }
-            Main.main.addLayer(new GpxLayer(toGpxData(true), tr("Converted from: {0}", getName())));
-            Main.main.removeLayer(EditGpxLayer.this);
+            Main.getLayerManager().addLayer(new GpxLayer(toGpxData(true), tr("Converted from: {0}", getName())));
+            Main.getLayerManager().removeLayer(EditGpxLayer.this);
         }
     }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java	(revision 32484)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java	(revision 32485)
@@ -165,5 +165,5 @@
         if(currentEditLayer == null) {
             currentEditLayer = new EditGpxLayer(new EditGpxData());
-            Main.main.addLayer(currentEditLayer);
+            Main.getLayerManager().addLayer(currentEditLayer);
             currentEditLayer.initializeImport();
         }
