Index: /applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
===================================================================
--- /applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(revision 28629)
+++ /applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(revision 28630)
@@ -27,5 +27,4 @@
  */
 package org.openstreetmap.josm.plugins.mapdust;
-
 
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -64,5 +63,4 @@
 import org.openstreetmap.josm.tools.Shortcut;
 
-
 /**
  * This is the main class of the MapDust plug-in. Defines the MapDust plug-in
@@ -84,7 +82,4 @@
     private CreateBugDialog dialog;
 
-    /** The JOSM user identity manager, it is used for obtaining the user name */
-    private final JosmUserIdentityManager userIdentityManager;
-
     /** The list of <code>MapdustBug</code> objects */
     private List<MapdustBug> mapdustBugList;
@@ -92,4 +87,7 @@
     /** The bounding box from where the MapDust bugs are down-loaded */
     private BoundingBox bBox;
+    
+    /** The shortcut to access MapDust GUI */
+    private Shortcut shortcut;
 
     /**
@@ -110,5 +108,4 @@
     public MapdustPlugin(PluginInformation info) {
         super(info);
-        this.userIdentityManager = JosmUserIdentityManager.getInstance();
         this.filter = null;
         this.bBox = null;
@@ -123,11 +120,7 @@
      */
     private void initializePlugin() {
-        /* create MapDust GUI */
-        Shortcut shortcut = Shortcut.registerShortcut("MapDust", tr("Toggle: {0}", tr("Open MapDust")),
+        /* create MapDust Shortcut */
+        this.shortcut = Shortcut.registerShortcut("MapDust", tr("Toggle: {0}", tr("Open MapDust")),
                 KeyEvent.VK_0, Shortcut.ALT_SHIFT);
-        String name = "MapDust bug reports";
-        String tooltip = "Activates the MapDust bug reporter plugin";
-        mapdustGUI = new MapdustGUI(tr(name), "mapdust_icon.png", tr(tooltip),
-                shortcut, 150, this);
         /* add default values for static variables */
         Main.pref.put("mapdust.pluginState", MapdustPluginState.ONLINE.getValue());
@@ -136,4 +129,5 @@
         Main.pref.put("mapdust.version", getPluginInformation().version);
         Main.pref.put("mapdust.localVersion",getPluginInformation().localversion);
+        Main.pref.addPreferenceChangeListener(this);
     }
 
@@ -148,24 +142,25 @@
     @Override
     public void mapFrameInitialized(MapFrame oldMapFrame, MapFrame newMapFrame) {
-        if (newMapFrame == null) {
+        if (newMapFrame != null) {
+            /* add MapDust dialog window */
+            mapdustGUI = new MapdustGUI(tr("MapDust bug reports"), "mapdust_icon.png", 
+            		tr("Activates the MapDust bug reporter plugin"), shortcut, 150, this);
+            /* add MapdustGUI */
+            mapdustGUI.setBounds(newMapFrame.getBounds());
+            mapdustGUI.addObserver(this);
+            newMapFrame.addToggleDialog(mapdustGUI);
+            /* add Listeners */
+            NavigatableComponent.addZoomChangeListener(this);
+            MapView.addLayerChangeListener(this);
+            newMapFrame.mapView.addMouseListener(this);
+            /* put username to preferences */
+            Main.pref.put("mapdust.josmUserName", JosmUserIdentityManager.getInstance().getUserName());
+        } else {
             /* if new MapFrame is null, remove listener */
+            oldMapFrame.mapView.removeMouseListener(this);
             MapView.removeLayerChangeListener(this);
             NavigatableComponent.removeZoomChangeListener(this);
-        } else {
-            /* add MapDust dialog window */
-            if (Main.map != null && Main.map.mapView != null) {
-                /* add MapdustGUI */
-                mapdustGUI.setBounds(newMapFrame.getBounds());
-                mapdustGUI.addObserver(this);
-                newMapFrame.addToggleDialog(mapdustGUI);
-                /* add Listeners */
-                NavigatableComponent.addZoomChangeListener(this);
-                MapView.addLayerChangeListener(this);
-                Main.map.mapView.addMouseListener(this);
-                Main.pref.addPreferenceChangeListener(this);
-                /* put username to preferences */
-                Main.pref.put("mapdust.josmUserName",
-                        userIdentityManager.getUserName());
-            }
+            mapdustGUI.removeObserver(this);
+            mapdustGUI = null;
         }
     }
@@ -183,8 +178,8 @@
     @Override
     public void preferenceChanged(PreferenceChangeEvent event) {
-        if (mapdustGUI.isShowing() && !wasError && mapdustLayer != null
+        if (mapdustGUI != null && mapdustGUI.isShowing() && !wasError && mapdustLayer != null
                 && mapdustLayer.isVisible()) {
             if (event.getKey().equals("osm-server.username")) {
-                String newUserName = userIdentityManager.getUserName();
+                String newUserName = JosmUserIdentityManager.getInstance().getUserName();
                 String oldUserName = Main.pref.get("mapdust.josmUserName");
                 String nickname = Main.pref.get("mapdust.nickname");
@@ -458,6 +453,6 @@
             NavigatableComponent.removeZoomChangeListener(this);
             Main.map.mapView.removeLayer(layer);
-            Main.map.remove(mapdustGUI);
             if (mapdustGUI != null) {
+                Main.map.remove(mapdustGUI);
                 mapdustGUI.destroy();
             }
@@ -476,5 +471,5 @@
     @Override
     public void zoomChanged() {
-        if (mapdustGUI.isShowing() && !wasError) {
+        if (mapdustGUI != null && mapdustGUI.isShowing() && !wasError) {
             boolean download = true;
             BoundingBox curentBBox = getBBox();
@@ -510,5 +505,5 @@
                 this.filter = filter;
             }
-            if (mapdustGUI.isShowing() && !wasError) {
+            if (mapdustGUI != null && mapdustGUI.isShowing() && !wasError) {
                 updatePluginData();
             }
Index: /applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java
===================================================================
--- /applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java	(revision 28629)
+++ /applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java	(revision 28630)
@@ -98,11 +98,11 @@
      */
     private String buildText() {
-        String version = Main.pref.get("mapdust.version");
-        String localVersion = Main.pref.get("mapdust.localVersion");
+        Integer version = Integer.decode(Main.pref.get("mapdust.version"));
+        Integer localVersion = Integer.decode(Main.pref.get("mapdust.localVersion"));
         String txt = "<html>";
         txt += "<font style='font-size:10px' face='Times New Roman'>";
         txt += "<b>You are using MapDust version ";
         txt += "<i style='color:red;font-size:10px'>";
-        if (version.equals(localVersion)) {
+        if (version <= localVersion) {
             txt += version + "</i>.</b><br>";
         } else {
