Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPref.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPref.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPref.java	(revision 22733)
@@ -5,8 +5,16 @@
  * implemented by the RequestHandler, and an error message to be displayed
  * if not permitted.
+ *
+ * Use @see PermissionPrefWithDefault instead of this class.
+ * 
+ * @author Bodo Meissner
  */
+ @Deprecated
 public class PermissionPref {
+	/** name of the preference setting to permit the remote operation */
 	String pref;
+	/** message to be displayed if operation is not permitted */
 	String message;
+	
 	public PermissionPref(String pref, String message)
 	{
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPrefWithDefault.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPrefWithDefault.java	(revision 22733)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPrefWithDefault.java	(revision 22733)
@@ -0,0 +1,22 @@
+package org.openstreetmap.josm.plugins.remotecontrol;
+
+/**
+ * This class should replace PermissionPref because it allows explicit 
+ * specification of the permission's default value.
+ * 
+ * @author Bodo Meissner
+ */
+@SuppressWarnings("deprecation")
+public class PermissionPrefWithDefault extends PermissionPref {
+
+	boolean defaultVal = true;
+
+	public PermissionPrefWithDefault(String pref, boolean defaultVal, String message) {
+		super(pref, message);
+		this.defaultVal = defaultVal;
+	}
+
+	public PermissionPrefWithDefault(PermissionPref prefWithoutDefault) {
+		super(prefWithoutDefault.pref, prefWithoutDefault.message);
+	}
+}
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java	(revision 22733)
@@ -8,11 +8,49 @@
 
 /**
-
+ * Base plugin for remote control operations. 
+ * This plugin contains operations that use JOSM core only.
+ * 
+ * Other plugins can register additional operations by calling 
+ * @see addRequestHandler().
+ * To allow API changes this plugin contains a @see getVersion() method.
+ * 
+ * IMPORTANT! increment the minor version on compatible API extensions
+ * and increment the major version and set minor to 0 on incompatible changes.
  */
 public class RemoteControlPlugin extends Plugin
 {
+	/** API version
+	 * IMPORTANT! update the version number on API changes.
+	 */
+	static final int apiMajorVersion = 1;
+	static final int apiMinorVersion = 0;
+	
+	/**
+	 * RemoteControl HTTP protocol version. Change minor number for compatible
+	 * interface extensions. Change major number in case of incompatible
+	 * changes.
+	 */
+	static final int protocolMajorVersion = 1;
+	static final int protocolMinorVersion = 2;
+	
     /** The HTTP server this plugin launches */
     static HttpServer server;
 
+    /**
+     * Returns an array of int values with major and minor API version 
+     * and major and minor HTTP protocol version.
+     *  
+     * The function returns an int[4] instead of an object with fields
+     * to avoid ClassNotFound errors with old versions of remotecontrol.
+     *  
+     * @return array of integer version numbers: 
+     *    apiMajorVersion, apiMinorVersion, protocolMajorVersion, protocolMajorVersion
+     */
+    public int[] getVersion()
+    {
+    	int versions[] = {apiMajorVersion, apiMinorVersion, protocolMajorVersion, protocolMajorVersion};
+    	return versions;
+    }
+    
     /**
      * Creates the plugin, and starts the HTTP server
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java	(revision 22733)
@@ -15,4 +15,8 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
+import org.openstreetmap.josm.plugins.remotecontrol.handler.AddNodeHandler;
+import org.openstreetmap.josm.plugins.remotecontrol.handler.ImportHandler;
+import org.openstreetmap.josm.plugins.remotecontrol.handler.LoadAndZoomHandler;
+import org.openstreetmap.josm.plugins.remotecontrol.handler.VersionHandler;
 import org.openstreetmap.josm.tools.GBC;
 
@@ -25,4 +29,5 @@
 {
     private JCheckBox permissionLoadData = new JCheckBox(tr("load data from API"));
+    private JCheckBox permissionImportData = new JCheckBox(tr("import data from URL"));
     private JCheckBox permissionCreateObjects = new JCheckBox(tr("create new objects"));
     private JCheckBox permissionChangeSelection = new JCheckBox(tr("change the selection"));
@@ -42,4 +47,5 @@
         perms.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.gray), tr("Permitted actions")));
         perms.add(permissionLoadData, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
+        perms.add(permissionImportData, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
         perms.add(permissionChangeSelection, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
         perms.add(permissionChangeViewport, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
@@ -51,20 +57,22 @@
         remote.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
 
-        permissionLoadData.setSelected(Main.pref.getBoolean("remotecontrol.permission.load-data", true));
-        permissionChangeSelection.setSelected(Main.pref.getBoolean("remotecontrol.permission.change-selection", true));
-        permissionChangeViewport.setSelected(Main.pref.getBoolean("remotecontrol.permission.change-viewport", true));
-        permissionCreateObjects.setSelected(Main.pref.getBoolean("remotecontrol.permission.create-objects", false));
-        permissionReadProtocolversion.setSelected(Main.pref.getBoolean("remotecontrol.permission.read-protocolversion", true));
-        alwaysAskUserConfirm.setSelected(Main.pref.getBoolean("remotecontrol.always-confirm", false));
+        permissionLoadData.setSelected(Main.pref.getBoolean(LoadAndZoomHandler.loadDataPermissionKey, LoadAndZoomHandler.loadDataPermissionDefault));
+        permissionImportData.setSelected(Main.pref.getBoolean(ImportHandler.permissionKey, ImportHandler.permissionDefault));
+        permissionChangeSelection.setSelected(Main.pref.getBoolean(LoadAndZoomHandler.changeSelectionPermissionKey, LoadAndZoomHandler.changeSelectionPermissionDefault));
+        permissionChangeViewport.setSelected(Main.pref.getBoolean(LoadAndZoomHandler.changeViewportPermissionKey, LoadAndZoomHandler.changeViewportPermissionDefault));
+        permissionCreateObjects.setSelected(Main.pref.getBoolean(AddNodeHandler.permissionKey, AddNodeHandler.permissionDefault));
+        permissionReadProtocolversion.setSelected(Main.pref.getBoolean(VersionHandler.permissionKey, VersionHandler.permissionDefault));
+        alwaysAskUserConfirm.setSelected(Main.pref.getBoolean(RequestHandler.globalConfirmationKey, RequestHandler.globalConfirmationDefault));
 
     }
 
     public boolean ok() {
-        Main.pref.put("remotecontrol.permission.load-data", permissionLoadData.isSelected());
-        Main.pref.put("remotecontrol.permission.change-selection", permissionChangeSelection.isSelected());
-        Main.pref.put("remotecontrol.permission.change-viewport", permissionChangeViewport.isSelected());
-        Main.pref.put("remotecontrol.permission.create-objects", permissionCreateObjects.isSelected());
-        Main.pref.put("remotecontrol.permission.read-protocolversion", permissionReadProtocolversion.isSelected());
-        Main.pref.put("remotecontrol.always-confirm", alwaysAskUserConfirm.isSelected());
+        Main.pref.put(LoadAndZoomHandler.loadDataPermissionKey, permissionLoadData.isSelected());
+        Main.pref.put(ImportHandler.permissionKey, permissionImportData.isSelected());
+        Main.pref.put(LoadAndZoomHandler.changeSelectionPermissionKey, permissionChangeSelection.isSelected());
+        Main.pref.put(LoadAndZoomHandler.changeViewportPermissionKey, permissionChangeViewport.isSelected());
+        Main.pref.put(AddNodeHandler.permissionKey, permissionCreateObjects.isSelected());
+        Main.pref.put(VersionHandler.permissionKey, permissionReadProtocolversion.isSelected());
+        Main.pref.put(RequestHandler.globalConfirmationKey, alwaysAskUserConfirm.isSelected());
         // FIXME confirm return value - really no restart needed?
         return false /* no restart needed */;
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandler.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandler.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandler.java	(revision 22733)
@@ -18,4 +18,7 @@
 public abstract class RequestHandler
 {
+	public static final String globalConfirmationKey = "remotecontrol.always-confirm";
+	public static final boolean globalConfirmationDefault = false;
+	
 	/** The GET request arguments */
 	protected HashMap<String,String> args;
@@ -30,5 +33,5 @@
 
     /** will be filled with the command assigned to the subclass */
-    private String myCommand;
+    protected String myCommand;
     
     /**
@@ -77,8 +80,10 @@
      * @return the preference name and error message or null
      */
-    public PermissionPref getPermissionPref()
+	@SuppressWarnings("deprecation")
+	public PermissionPref getPermissionPref()
     {
         /* Example:
-        return new PermissionPref("fooobar.remotecontrol",
+        return new PermissionPrefWithDefault("fooobar.remotecontrol",
+        true
         "RemoteControl: foobar forbidden by preferences");
         */
@@ -97,15 +102,29 @@
      * @throws RequestHandlerForbiddenException
      */
-    final public void checkPermission() throws RequestHandlerForbiddenException
+    @SuppressWarnings("deprecation")
+	final public void checkPermission() throws RequestHandlerForbiddenException
     {
         /* 
          * If the subclass defines a specific preference and if this is set
          * to false, abort with an error message.
+         * 
+         * Note: we use the deprecated class here for compatibility with
+         * older versions of WMSPlugin.
          */
         PermissionPref permissionPref = getPermissionPref();
         if((permissionPref != null) && (permissionPref.pref != null))
         {
-            if (!Main.pref.getBoolean(permissionPref.pref, true)) {
-                System.out.println(permissionPref.message);
+            PermissionPrefWithDefault permissionPrefWithDefault;
+            if(permissionPref instanceof PermissionPrefWithDefault)
+            {
+            	permissionPrefWithDefault = (PermissionPrefWithDefault) permissionPref;
+            }
+            else 
+            {
+            	permissionPrefWithDefault = new PermissionPrefWithDefault(permissionPref);
+            }
+            if (!Main.pref.getBoolean(permissionPrefWithDefault.pref,
+            		permissionPrefWithDefault.defaultVal)) {
+                System.out.println(permissionPrefWithDefault.message);
                 throw new RequestHandlerForbiddenException();
             }
@@ -115,5 +134,5 @@
          * If yes, display specific confirmation message.
          */
-        if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) {
+        if (Main.pref.getBoolean(globalConfirmationKey, globalConfirmationDefault)) {
             if (JOptionPane.showConfirmDialog(Main.parent,
                 "<html>" + getPermissionMessage() +
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 22733)
@@ -28,5 +28,8 @@
 	 * changes.
 	 */
-	public static final String PROTOCOLVERSION = "{\"protocolversion\": {\"major\": 1, \"minor\": 0}, \"application\": \"JOSM RemoteControl\"}";
+	public static final String PROTOCOLVERSION = "{\"protocolversion\": {\"major\": " +
+		RemoteControlPlugin.protocolMajorVersion + ", \"minor\": " + 
+		RemoteControlPlugin.protocolMinorVersion +
+		"}, \"application\": \"JOSM RemoteControl\"}";
 
 	/** The socket this processor listens on */
@@ -82,10 +85,14 @@
 	private static void addRequestHandlerClass(String command,
 				Class<? extends RequestHandler> handler, boolean silent) {
-		if (handlers.get(command) != null) {
-			System.out.println("RemoteControl: duplicate command " + command
+		if(command.charAt(0) == '/')
+		{
+			command = command.substring(1);
+		}
+		if (handlers.get("/" + command) != null) {
+			System.out.println("RemoteControl: ignoring duplicate command " + command
 					+ " with handler " + handler.getName());
 		} else {
-			if(!silent) System.out.println("RemoteControl: adding command command " + 
-					command + " (handled by " + handler.getName() + ")");
+			if(!silent) System.out.println("RemoteControl: adding command \"" + 
+					command + "\" (handled by " + handler.getSimpleName() + ")");
 			handlers.put(command, handler);
 		}
@@ -95,4 +102,6 @@
 	static {
 		addRequestHandlerClass(LoadAndZoomHandler.command,
+				LoadAndZoomHandler.class, true);
+		addRequestHandlerClass(LoadAndZoomHandler.command2,
 				LoadAndZoomHandler.class, true);
 		addRequestHandlerClass(AddNodeHandler.command, AddNodeHandler.class, true);
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/AddNodeHandler.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/AddNodeHandler.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/AddNodeHandler.java	(revision 22733)
@@ -9,7 +9,6 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.plugins.remotecontrol.PermissionPref;
+import org.openstreetmap.josm.plugins.remotecontrol.PermissionPrefWithDefault;
 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandler;
-import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerBadRequestException;
 
 /**
@@ -18,5 +17,7 @@
 public class AddNodeHandler extends RequestHandler {
 
-	public static final String command = "/add_node";
+	public static final String command = "add_node";
+	public static final String permissionKey = "remotecontrol.permission.create-objects";
+	public static final boolean permissionDefault = false;
 
 	@Override
@@ -37,7 +38,7 @@
 
 	@Override
-	public PermissionPref getPermissionPref()
+	public PermissionPrefWithDefault getPermissionPref()
 	{
-		return new PermissionPref("remotecontrol.permission.create-objects",
+		return new PermissionPrefWithDefault(permissionKey, permissionDefault,
 				"RemoteControl: creating objects forbidden by preferences");
 	}
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/ImportHandler.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/ImportHandler.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/ImportHandler.java	(revision 22733)
@@ -7,7 +7,6 @@
 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
 import org.openstreetmap.josm.actions.downloadtasks.DownloadTask;
-import org.openstreetmap.josm.plugins.remotecontrol.PermissionPref;
+import org.openstreetmap.josm.plugins.remotecontrol.PermissionPrefWithDefault;
 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandler;
-import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerBadRequestException;
 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerErrorException;
 
@@ -17,5 +16,7 @@
 public class ImportHandler extends RequestHandler {
 
-	public static final String command = "/import";
+	public static final String command = "import";
+	public static final String permissionKey = "remotecontrol.permission.import";
+	public static final boolean permissionDefault = true;
 
 	@Override
@@ -44,7 +45,7 @@
 
 	@Override
-	public PermissionPref getPermissionPref()
+	public PermissionPrefWithDefault getPermissionPref()
 	{
-		return new PermissionPref("remotecontrol.permission.import",
+		return new PermissionPrefWithDefault(permissionKey, permissionDefault,
 				"RemoteControl: import forbidden by preferences");
 	}
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/LoadAndZoomHandler.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/LoadAndZoomHandler.java	(revision 22733)
@@ -22,5 +22,4 @@
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandler;
-import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerBadRequestException;
 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerErrorException;
 
@@ -30,6 +29,14 @@
 public class LoadAndZoomHandler extends RequestHandler
 {
-	public static final String command = "/load_and_zoom";
-
+	public static final String command = "load_and_zoom";
+	public static final String command2 = "zoom";
+	
+	public static final String loadDataPermissionKey = "remotecontrol.permission.load-data";
+	public static final boolean loadDataPermissionDefault = true;
+	public static final String changeSelectionPermissionKey = "remotecontrol.permission.change-selection";
+	public static final boolean changeSelectionPermissionDefault = true;
+	public static final String changeViewportPermissionKey = "remotecontrol.permission.change-viewport";
+	public static final boolean changeViewportPermissionDefault = true;
+	
     @Override
     public String getPermissionMessage()
@@ -59,38 +66,41 @@
 			maxlon = Double.parseDouble(args.get("right"));
 
-			if (!Main.pref.getBoolean("remotecontrol.permission.load-data", true))
+			if(command.equals(myCommand))
 			{
-				System.out.println("RemoteControl: download forbidden by preferences");
-			}
-			else
-			{
-
-				// find out whether some data has already been downloaded
-				Area present = null;
-				Area toDownload = null;
-				DataSet ds = Main.main.getCurrentDataSet();
-				if (ds != null)
-					present = ds.getDataSourceArea();
-				if (present != null && !present.isEmpty()) {
-					toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
-					toDownload.subtract(present);
-					if (!toDownload.isEmpty())
-					{
-						// the result might not be a rectangle (L shaped etc)
-						Rectangle2D downloadBounds = toDownload.getBounds2D();
-						minlat = downloadBounds.getMinY();
-						minlon = downloadBounds.getMinX();
-						maxlat = downloadBounds.getMaxY();
-						maxlon = downloadBounds.getMaxX();
-					}
-				}
-				if((toDownload != null) && toDownload.isEmpty())
+				if (!Main.pref.getBoolean(loadDataPermissionKey, loadDataPermissionDefault))
 				{
-					System.out.println("RemoteControl: no download necessary");
+					System.out.println("RemoteControl: download forbidden by preferences");
 				}
 				else
 				{
-                    Future<?> future = osmTask.download(false /*no new layer*/, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);
-                    Main.worker.submit(new PostDownloadHandler(osmTask, future));
+	
+					// find out whether some data has already been downloaded
+					Area present = null;
+					Area toDownload = null;
+					DataSet ds = Main.main.getCurrentDataSet();
+					if (ds != null)
+						present = ds.getDataSourceArea();
+					if (present != null && !present.isEmpty()) {
+						toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
+						toDownload.subtract(present);
+						if (!toDownload.isEmpty())
+						{
+							// the result might not be a rectangle (L shaped etc)
+							Rectangle2D downloadBounds = toDownload.getBounds2D();
+							minlat = downloadBounds.getMinY();
+							minlon = downloadBounds.getMinX();
+							maxlat = downloadBounds.getMaxY();
+							maxlon = downloadBounds.getMaxX();
+						}
+					}
+					if((toDownload != null) && toDownload.isEmpty())
+					{
+						System.out.println("RemoteControl: no download necessary");
+					}
+					else
+					{
+	                    Future<?> future = osmTask.download(false /*no new layer*/, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);
+	                    Main.worker.submit(new PostDownloadHandler(osmTask, future));
+					}
 				}
 			}
@@ -100,5 +110,5 @@
 			throw new RequestHandlerErrorException();
 		}
-		if (args.containsKey("select") && Main.pref.getBoolean("remotecontrol.permission.change-selection", true)) {
+		if (args.containsKey("select") && Main.pref.getBoolean(changeSelectionPermissionKey, changeSelectionPermissionDefault)) {
 			// select objects after downloading, zoom to selection.
 			final String selection = args.get("select");
@@ -129,24 +139,28 @@
 					for (Relation r : ds.getRelations()) if (relations.contains(r.getId())) newSel.add(r);
 					ds.setSelected(newSel);
-					if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true))
+					if (Main.pref.getBoolean(changeViewportPermissionKey, changeViewportPermissionDefault))
 						new AutoScaleAction("selection").actionPerformed(null);
 				}
 			});
-		} else if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true)) {
+		} else if (Main.pref.getBoolean(changeViewportPermissionKey, changeViewportPermissionDefault)) {
 			// after downloading, zoom to downloaded area.
-			final Bounds bounds = new Bounds(new LatLon(minlat, minlon),
-					new LatLon(maxlat, maxlon));
+			zoom(minlat, maxlat, minlon, maxlon);
+		}
+	}
 
-			// make sure this isn't called unless there *is* a MapView
-			//
-			if (Main.map != null && Main.map.mapView != null) {
-				Main.worker.execute(new Runnable() {
-					public void run() {
-						BoundingXYVisitor bbox = new BoundingXYVisitor();
-						bbox.visit(bounds);
-						Main.map.mapView.recalculateCenterScale(bbox);
-					}
-				});
-			}
+	protected void zoom(double minlat, double maxlat, double minlon, double maxlon) {
+		final Bounds bounds = new Bounds(new LatLon(minlat, minlon),
+				new LatLon(maxlat, maxlon));
+
+		// make sure this isn't called unless there *is* a MapView
+		//
+		if (Main.map != null && Main.map.mapView != null) {
+			Main.worker.execute(new Runnable() {
+				public void run() {
+					BoundingXYVisitor bbox = new BoundingXYVisitor();
+					bbox.visit(bounds);
+					Main.map.mapView.recalculateCenterScale(bbox);
+				}
+			});
 		}
 	}
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/VersionHandler.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/VersionHandler.java	(revision 22732)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/VersionHandler.java	(revision 22733)
@@ -3,5 +3,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import org.openstreetmap.josm.plugins.remotecontrol.PermissionPref;
+import org.openstreetmap.josm.plugins.remotecontrol.PermissionPrefWithDefault;
 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandler;
 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerBadRequestException;
@@ -14,5 +14,7 @@
 public class VersionHandler extends RequestHandler {
 
-	public static final String command = "/version";
+	public static final String command = "version";
+	public static final String permissionKey = "remotecontrol.permission.read-protocolversion";
+	public static final boolean permissionDefault = true;
 
 	@Override
@@ -31,7 +33,8 @@
 	}
 
-	public PermissionPref getPermissionPref()
+	@Override
+	public PermissionPrefWithDefault getPermissionPref()
 	{
-		return new PermissionPref("remotecontrol.permission.read-protocolversion",
+		return new PermissionPrefWithDefault(permissionKey, permissionDefault,
 				"RemoteControl: /version forbidden by preferences");
 	}
