Index: src/org/openstreetmap/josm/Main.java
===================================================================
--- src/org/openstreetmap/josm/Main.java	(revision 92)
+++ src/org/openstreetmap/josm/Main.java	(revision 93)
@@ -322,10 +322,10 @@
 			} else if (s.startsWith("--selection=")) {
 				SelectionListDialog.search(s.substring(12), SelectionListDialog.SearchMode.add);
-			} else if (s.startsWith("http:") || s.startsWith("ftp:") || s.startsWith("https:")) {
+			} else if (s.startsWith("http:")) {
 				Bounds b = DownloadAction.osmurl2bounds(s);
 				if (b == null)
-					System.out.println("Ignoring malformed url: "+s);
+					JOptionPane.showMessageDialog(main, "Ignoring malformed url: "+s);
 				else
-					Main.main.downloadAction.download(false, b.min.lat(), b.min.lon(), b.max.lat(), b.max.lon());
+					main.downloadAction.download(false, b.min.lat(), b.min.lon(), b.max.lat(), b.max.lon());
 			} else {
 				main.openAction.openFile(new File(s));
@@ -344,6 +344,4 @@
 	private static void downloadFromParamString(boolean rawGps, String s) {
 		s = s.replaceAll("^(osm:/?/?)|(--download(gps)?=)", "");
-		System.out.println(s);
-		System.exit(1);
 		StringTokenizer st = new StringTokenizer(s, ",");
 		if (st.countTokens() != 4) {
@@ -355,5 +353,5 @@
 			main.downloadAction.download(rawGps, Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));
 		} catch (NumberFormatException e) {
-			JOptionPane.showMessageDialog(main, "Could not parse the Coordinates.");
+			JOptionPane.showMessageDialog(main, "Could not parse the Coordinates: "+s);
 		}
 	}
Index: src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 93)
@@ -5,6 +5,5 @@
 import java.util.Collection;
 
-import javax.swing.KeyStroke;
-import javax.swing.MenuElement;
+import javax.swing.AbstractAction;
 
 import org.openstreetmap.josm.Main;
@@ -16,4 +15,5 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.tools.ImageProvider;
 
 /**
@@ -27,20 +27,23 @@
 	private final MapFrame mapFrame;
 
-	private class Action extends JosmAction {
+	private class Action extends AbstractAction {
 		private final AutoScaleMode mode;
 		public Action(AutoScaleMode mode) {
-	        super("Auto Scale: "+mode, "dialogs/autoscale/"+mode, "Auto zoom the view to "+mode+". Disabled if the view is moved.", "Alt-A", KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_MASK));
+			super("Auto Scale: "+mode, ImageProvider.get("dialogs/autoscale/"+mode));
+			putValue(SHORT_DESCRIPTION, "Auto zoom the view to "+mode+". Disabled if the view is moved.");
 			this.mode = mode;
-        }
+		}
 		public void actionPerformed(ActionEvent e) {
 			AutoScaleAction.this.mode = mode;
-			if (e.getSource() instanceof MenuElement)
-				setAutoScaleOnMapView();
-			else
-				mapFrame.mapView.setAutoScale(!mapFrame.mapView.isAutoScale());
-        }
+			if (mapFrame.mapView.isAutoScale())
+            	mapFrame.mapView.recalculateCenterScale();
+            else
+            	mapFrame.mapView.setAutoScale(true);
+			putValue("active", true);
+		}
 	}
-	
+
 	public AutoScaleAction(final MapFrame mapFrame) {
+		super(KeyEvent.VK_A, 0);
 		for (AutoScaleMode mode : AutoScaleMode.values())
 			actions.add(new Action(mode));
@@ -51,5 +54,5 @@
 				if (mode == AutoScaleMode.selection)
 					mapFrame.mapView.recalculateCenterScale();
-            }
+			}
 		});
 	}
@@ -79,11 +82,4 @@
 		}
 		return v;
-    }
-
-	private void setAutoScaleOnMapView() {
-    	if (mapFrame.mapView.isAutoScale())
-    		mapFrame.mapView.recalculateCenterScale();
-    	else
-    		mapFrame.mapView.setAutoScale(true);
-    }
+	}
 }
Index: src/org/openstreetmap/josm/actions/GroupAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/GroupAction.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/GroupAction.java	(revision 93)
@@ -3,12 +3,15 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.Icon;
 import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
+import javax.swing.KeyStroke;
 
 import org.openstreetmap.josm.gui.IconToggleButton;
@@ -17,14 +20,50 @@
 
 
-public class GroupAction extends AbstractAction {
+public class GroupAction extends JosmAction {
 
 	protected final List<Action> actions = new ArrayList<Action>();
-	private int current;
+	private int current = -1;
+	private String shortCutName = "";
+
+	private PropertyChangeListener forwardActiveListener = new PropertyChangeListener(){
+		public void propertyChange(PropertyChangeEvent evt) {
+			if (evt.getPropertyName().equals("active")) {
+				putValue("active", evt.getNewValue());
+				if (evt.getNewValue() == Boolean.FALSE)
+					cycle = false;
+			}
+		}
+	};
+	public boolean cycle;
 
 	protected void setCurrent(int current) {
+		if (this.current != -1)
+			actions.get(this.current).removePropertyChangeListener(forwardActiveListener);
+		actions.get(current).addPropertyChangeListener(forwardActiveListener);
+
 		this.current = current;
 		putValue(SMALL_ICON, ImageProvider.overlay((Icon)actions.get(current).getValue(SMALL_ICON), "right", OverlayPosition.SOUTHEAST));
-		putValue(SHORT_DESCRIPTION, actions.get(current).getValue(SHORT_DESCRIPTION));
-    }
+		Object tooltip = actions.get(current).getValue(SHORT_DESCRIPTION);
+		putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+shortCutName+"</font>&nbsp;</html>");
+	}
+
+	public GroupAction(int shortCut, int modifiers) {
+		registerShortCut(getClass().getName(), KeyStroke.getKeyStroke(shortCut, modifiers));
+		if ((modifiers & KeyEvent.CTRL_DOWN_MASK) != 0)
+			shortCutName += "Ctrl-";
+		if ((modifiers & KeyEvent.ALT_DOWN_MASK) != 0)
+			shortCutName += "Alt-";
+		if ((modifiers & KeyEvent.ALT_GRAPH_DOWN_MASK) != 0)
+			shortCutName += "AltGr-";
+		if ((modifiers & KeyEvent.SHIFT_DOWN_MASK) != 0)
+			shortCutName += "Shift-";
+		shortCutName += Character.toUpperCase((char)shortCut);
+		addPropertyChangeListener(new PropertyChangeListener(){
+			public void propertyChange(PropertyChangeEvent evt) {
+				if (evt.getPropertyName().equals("active") && evt.getNewValue() == Boolean.FALSE)
+					cycle = false;
+            }
+		});
+	}
 
 	public void actionPerformed(ActionEvent e) {
@@ -33,7 +72,12 @@
 			b.setSelected(!b.isSelected());
 			openPopup(b);
-		} else
+		} else {
+			if (cycle)
+				setCurrent((current+1)%actions.size());
+			else
+				cycle = true;
 			actions.get(current).actionPerformed(e);
-    }
+		}
+	}
 
 	private void openPopup(IconToggleButton b) {
@@ -45,9 +89,9 @@
 				public void actionPerformed(ActionEvent e) {
 					setCurrent(j);
-                }
+				}
 			});
 			popup.add(item);
 		}
 		popup.show(b, b.getWidth(), 0);
-    }
+	}
 }
Index: src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/JosmAction.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/JosmAction.java	(revision 93)
@@ -33,6 +33,13 @@
 		super(name, ImageProvider.get(iconName));
 		putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+shortCutName+"</font>&nbsp;</html>");
-		Main.main.panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(shortCut, name);
-		Main.main.panel.getActionMap().put(name, this);
+		registerShortCut(name, shortCut);
+	}
+
+	public JosmAction() {
+	}
+
+	public void registerShortCut(String idName, KeyStroke shortCut) {
+		Main.main.panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(shortCut, idName);
+		Main.main.panel.getActionMap().put(idName, this);
 	}
 }
Index: src/org/openstreetmap/josm/actions/WmsServerAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/WmsServerAction.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/WmsServerAction.java	(revision 93)
@@ -39,5 +39,5 @@
             }
         } else {
-            WmsServerLayer layer = new WmsServerLayer(Main.pref.get("wmsServerBaseUrl", "http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&width=512&height=512&layers=global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg&"));
+            WmsServerLayer layer = new WmsServerLayer(Main.pref.get("wms.baseurl", "http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&width=512&height=512&layers=global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg&"));
             if (mapFrame == null)
                 Main.main.setMapFrame(new MapFrame(layer));
Index: src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java	(revision 93)
@@ -3,10 +3,19 @@
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
 
 import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.GroupAction;
 import org.openstreetmap.josm.command.AddCommand;
+import org.openstreetmap.josm.command.ChangeCommand;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Segment;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MapFrame;
 
@@ -23,6 +32,19 @@
 public class AddNodeAction extends MapMode {
 
-	public AddNodeAction(MapFrame mapFrame) {
-		super("Add nodes", "addnode", "Add nodes to the map.", "N", KeyEvent.VK_N, mapFrame);
+	enum Mode {node, nodesegment}
+	private final Mode mode;
+
+	public static class AddNodeGroup extends GroupAction {
+		public AddNodeGroup(MapFrame mf) {
+			super(KeyEvent.VK_N,0);
+			actions.add(new AddNodeAction(mf, "Add node", Mode.node, "Add a new node to the map"));
+			actions.add(new AddNodeAction(mf, "Add node into segment", Mode.nodesegment, "Add a node into an existing segment"));
+			setCurrent(0);
+		}
+	}
+
+	public AddNodeAction(MapFrame mapFrame, String name, Mode mode, String desc) {
+		super(name, "node/"+mode, desc, mapFrame);
+		this.mode = mode;
 	}
 
@@ -40,15 +62,54 @@
 	 * If user clicked with the left button, add a node at the current mouse
 	 * position.
+	 * 
+	 * If in nodesegment mode, add the node to the line segment by splitting the
+	 * segment. The new created segment will be inserted in every way the segment
+	 * was part of.
 	 */
 	@Override public void mouseClicked(MouseEvent e) {
-		if (e.getButton() == MouseEvent.BUTTON1) {
-			Node node = new Node(mv.getLatLon(e.getX(), e.getY()));
-			if (node.coor.isOutSideWorld()) {
-				JOptionPane.showMessageDialog(Main.main, "Can not add a node outside of the world.");
+		if (e.getButton() != MouseEvent.BUTTON1)
+			return;
+
+		Node n = new Node(mv.getLatLon(e.getX(), e.getY()));
+		if (n.coor.isOutSideWorld()) {
+			JOptionPane.showMessageDialog(Main.main, "Can not add a node outside of the world.");
+			return;
+		}
+
+		Command c = new AddCommand(n);
+		if (mode == Mode.nodesegment) {
+			Segment s = mv.getNearestSegment(e.getPoint());
+			if (s == null)
 				return;
+
+			Collection<Command> cmds = new LinkedList<Command>();
+			cmds.add(c);
+			Segment s1 = new Segment(s);
+			s1.to = n;
+			Segment s2 = new Segment(s.from, s.to);
+			s2.from = n;
+
+			cmds.add(new ChangeCommand(s, s1));
+			cmds.add(new AddCommand(s2));
+
+			// Add the segment to every way
+			for (Way wold : Main.ds.ways) {
+				if (wold.segments.contains(s)) {
+					Way wnew = new Way(wold);
+					Collection<Segment> segs = new ArrayList<Segment>(wnew.segments);
+					wnew.segments.clear();
+					for (Segment waySeg : segs) {
+						wnew.segments.add(waySeg);
+						if (waySeg == s)
+							wnew.segments.add(s2);
+					}
+					cmds.add(new ChangeCommand(wold, wnew));
+				}
 			}
-			mv.editLayer().add(new AddCommand(Main.ds, node));
-			mv.repaint();
+
+			c = new SequenceCommand(cmds);
 		}
+		mv.editLayer().add(c);
+		mv.repaint();
 	}
 }
Index: src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java	(revision 93)
@@ -136,5 +136,5 @@
 
 			Segment ls = new Segment(start, end);
-			mv.editLayer().add(new AddCommand(Main.ds, ls));
+			mv.editLayer().add(new AddCommand(ls));
 		}
 
Index: src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java	(revision 93)
@@ -118,7 +118,7 @@
 		}
 		
-		Way t = new Way();
-		t.segments.addAll(sortedSegments);
-		mv.editLayer().add(new AddCommand(Main.ds, t));
+		Way w = new Way();
+		w.segments.addAll(sortedSegments);
+		mv.editLayer().add(new AddCommand(w));
 		Main.ds.clearSelection();
 		mv.repaint();
Index: src/org/openstreetmap/josm/actions/mapmode/MapMode.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 92)
+++ src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 93)
@@ -11,4 +11,5 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.tools.ImageProvider;
 
 /**
@@ -32,8 +33,19 @@
 
 	/**
-	 * Construct a mapMode with the given icon and the given MapFrame
+	 * Constructor for mapmodes without an menu
 	 */
 	public MapMode(String name, String iconName, String tooltip, String keyname, int keystroke, MapFrame mapFrame) {
 		super(name, "mapmode/"+iconName, tooltip, keyname, KeyStroke.getKeyStroke(keystroke, 0));
+		this.mapFrame = mapFrame;
+		mv = mapFrame.mapView;
+	}
+
+	/**
+	 * Constructor for mapmodes with an menu (no shortcut will be registered)
+	 */
+	public MapMode(String name, String iconName, String tooltip, MapFrame mapFrame) {
+		putValue(NAME, name);
+		putValue(SMALL_ICON, ImageProvider.get("mapmode", iconName));
+		putValue(SHORT_DESCRIPTION, tooltip);
 		this.mapFrame = mapFrame;
 		mv = mapFrame.mapView;
@@ -45,7 +57,7 @@
 	 */
 	public void registerListener() {
-		firePropertyChange("active", false, true);
+		putValue("active", true);
 	}
-	
+
 	/**
 	 * Unregister all listener previously registered. 
@@ -53,5 +65,5 @@
 	 */
 	public void unregisterListener() {
-		firePropertyChange("active", true, false);
+		putValue("active", false);
 	}
 
Index: src/org/openstreetmap/josm/command/AddCommand.java
===================================================================
--- src/org/openstreetmap/josm/command/AddCommand.java	(revision 92)
+++ src/org/openstreetmap/josm/command/AddCommand.java	(revision 93)
@@ -3,5 +3,5 @@
 import java.util.Collection;
 
-import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.visitor.AddVisitor;
@@ -17,9 +17,4 @@
 
 	/**
-	 * The dataset this command operates on.
-	 */
-	private DataSet ds;
-
-	/**
 	 * The primitive to add to the dataset.
 	 */
@@ -29,15 +24,14 @@
 	 * Create the command and specify the element to add.
 	 */
-	public AddCommand(DataSet ds, OsmPrimitive osm) {
-		this.ds = ds;
+	public AddCommand(OsmPrimitive osm) {
 		this.osm = osm;
 	}
 
 	@Override public void executeCommand() {
-		osm.visit(new AddVisitor(ds));
+		osm.visit(new AddVisitor(Main.ds));
 	}
 
 	@Override public void undoCommand() {
-		osm.visit(new DeleteVisitor(ds));
+		osm.visit(new DeleteVisitor(Main.ds));
 	}
 
Index: src/org/openstreetmap/josm/command/ChangeCommand.java
===================================================================
--- src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 93)
+++ src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 93)
@@ -0,0 +1,25 @@
+package org.openstreetmap.josm.command;
+
+import java.util.Collection;
+
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+
+public class ChangeCommand extends Command {
+
+	private final OsmPrimitive osm;
+	private final OsmPrimitive newOsm;
+
+	public ChangeCommand(OsmPrimitive osm, OsmPrimitive newOsm) {
+		this.osm = osm;
+		this.newOsm = newOsm;
+    }
+
+	@Override public void executeCommand() {
+	    super.executeCommand();
+	    osm.cloneFrom(newOsm);
+    }
+
+	@Override public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
+		modified.add(osm);
+    }
+}
Index: src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
===================================================================
--- src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java	(revision 92)
+++ src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java	(revision 93)
@@ -6,6 +6,6 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Segment;
-import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.NavigatableComponent;
@@ -32,4 +32,5 @@
 	 */
 	private final NavigatableComponent nc;
+	private static final double PHI = Math.toRadians(20);
 
 	/**
@@ -75,4 +76,5 @@
 			}
 		}
+
 		for (Segment ls : w.segments)
 			if (!ls.selected) // selected already in good color
@@ -104,4 +106,10 @@
 		Point p2 = nc.getPoint(ls.to.eastNorth);
 		g.drawLine(p1.x, p1.y, p2.x, p2.y);
+
+		if (Main.pref.getBoolean("draw.segment.direction")) {
+			double t = Math.atan2(p2.y-p1.y, p2.x-p1.x) + Math.PI;
+	        g.drawLine(p2.x,p2.y, (int)(p2.x + 10*Math.cos(t-PHI)), (int)(p2.y + 10*Math.sin(t-PHI)));
+	        g.drawLine(p2.x,p2.y, (int)(p2.x + 10*Math.cos(t+PHI)), (int)(p2.y + 10*Math.sin(t+PHI)));
+		}
 	}
 
Index: src/org/openstreetmap/josm/gui/IconToggleButton.java
===================================================================
--- src/org/openstreetmap/josm/gui/IconToggleButton.java	(revision 92)
+++ src/org/openstreetmap/josm/gui/IconToggleButton.java	(revision 93)
@@ -34,5 +34,5 @@
 		addMouseListener(new MouseAdapter(){
 			@Override public void mousePressed(MouseEvent e) {
-				groupbutton = e.getX() > getWidth()/3 && e.getY() > getHeight()/3;
+				groupbutton = e.getX() > getWidth()/2 && e.getY() > getHeight()/2;
             }
 		});
Index: src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- src/org/openstreetmap/josm/gui/MapFrame.java	(revision 92)
+++ src/org/openstreetmap/josm/gui/MapFrame.java	(revision 93)
@@ -5,4 +5,5 @@
 import java.awt.Container;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -16,5 +17,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.AutoScaleAction;
-import org.openstreetmap.josm.actions.mapmode.AddNodeAction;
 import org.openstreetmap.josm.actions.mapmode.AddSegmentAction;
 import org.openstreetmap.josm.actions.mapmode.AddWayAction;
@@ -24,4 +24,5 @@
 import org.openstreetmap.josm.actions.mapmode.SelectionAction;
 import org.openstreetmap.josm.actions.mapmode.ZoomAction;
+import org.openstreetmap.josm.actions.mapmode.AddNodeAction.AddNodeGroup;
 import org.openstreetmap.josm.gui.dialogs.ConflictDialog;
 import org.openstreetmap.josm.gui.dialogs.LayerList;
@@ -69,5 +70,5 @@
 		setLayout(new BorderLayout());
 
-		AutoScaleAction autoScaleAction = new AutoScaleAction(this);
+		final AutoScaleAction autoScaleAction = new AutoScaleAction(this);
 		add(mapView = new MapView(autoScaleAction), BorderLayout.CENTER);
 		mapView.addLayer(layer);
@@ -79,5 +80,5 @@
 		toolBarActions.add(new IconToggleButton(selectionAction));
 		toolBarActions.add(new IconToggleButton(new MoveAction(this)));
-		toolBarActions.add(new IconToggleButton(new AddNodeAction(this)));
+		toolBarActions.add(new IconToggleButton(new AddNodeGroup(this)));
 		toolBarActions.add(new IconToggleButton(new AddSegmentAction(this)));
 		toolBarActions.add(new IconToggleButton(new AddWayAction(this, selectionAction)));
@@ -97,9 +98,18 @@
 		autoScaleButton.setText(null);
 		autoScaleButton.setSelected(mapView.isAutoScale());
+		autoScaleAction.putValue("active", true);
 		mapView.addPropertyChangeListener(new PropertyChangeListener(){
 			public void propertyChange(PropertyChangeEvent evt) {
-				if (evt.getPropertyName().equals("autoScale"))
-					autoScaleButton.setSelected(mapView.isAutoScale());
+				if (evt.getPropertyName().equals("autoScale")) {
+					autoScaleAction.putValue("active", evt.getNewValue());
+					autoScaleButton.setSelected((Boolean)evt.getNewValue());
+				}
 			}
+		});
+		autoScaleButton.addActionListener(new ActionListener(){
+			public void actionPerformed(ActionEvent e) {
+				if (!autoScaleButton.groupbutton)
+					autoScaleButton.setSelected(true);
+            }
 		});
 
@@ -146,4 +156,6 @@
 	 */
 	public void selectMapMode(MapMode mapMode) {
+		if (mapMode == this.mapMode)
+			return;
 		if (this.mapMode != null)
 			this.mapMode.unregisterListener();
Index: src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- src/org/openstreetmap/josm/gui/MapView.java	(revision 92)
+++ src/org/openstreetmap/josm/gui/MapView.java	(revision 93)
@@ -53,5 +53,5 @@
 	 * Whether to adjust the scale property on every resize.
 	 */
-	boolean autoScale = true;
+	private boolean autoScale = true;
 
 	/**
Index: src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 92)
+++ src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 93)
@@ -104,31 +104,10 @@
 
 	/**
-	 * Return the object, that is nearest to the given screen point.
-	 * 
-	 * First, a node will be searched. If a node within 10 pixel is found, the
-	 * nearest node is returned.
-	 * 
-	 * If no node is found, search for pending segments.
-	 * 
-	 * If no such segment is found, and a non-pending segment is 
-	 * within 10 pixel to p, this segment is returned, except when 
-	 * <code>wholeWay</code> is <code>true</code>, in which case the 
-	 * corresponding Way is returned.
-	 * 
-	 * If no segment is found and the point is within an area, return that
-	 * area.
-	 * 
-	 * If no area is found, return <code>null</code>.
-	 * 
-	 * @param p				 The point on screen.
-	 * @param segmentInsteadWay Whether the segment (true) or only the whole
-	 * 					 	 way should be returned.
-	 * @return	The primitive, that is nearest to the point p.
-	 */
-	public OsmPrimitive getNearest(Point p, boolean segmentInsteadWay) {
+	 * Return the nearest point to the screen point given.
+	 * If a node within 10 pixel is found, the nearest node is returned.
+	 */
+	public final Node getNearestNode(Point p) {
 		double minDistanceSq = Double.MAX_VALUE;
-		OsmPrimitive minPrimitive = null;
-	
-		// nodes
+		Node minPrimitive = null;
 		for (Node n : Main.ds.nodes) {
 			if (n.deleted)
@@ -141,33 +120,40 @@
 			}
 		}
-		if (minPrimitive != null)
-			return minPrimitive;
-		
-		// for whole ways, try the ways first
-		minDistanceSq = Double.MAX_VALUE;
-		if (!segmentInsteadWay) {
-			for (Way w : Main.ds.ways) {
-				if (w.deleted)
+		return minPrimitive;
+	}
+
+	/**
+	 * @return the nearest way to the screen point given.
+	 */
+	public final Way getNearestWay(Point p) {
+		Way minPrimitive = null;
+		double minDistanceSq = Double.MAX_VALUE;
+		for (Way w : Main.ds.ways) {
+			if (w.deleted)
+				continue;
+			for (Segment ls : w.segments) {
+				if (ls.deleted || ls.incomplete)
 					continue;
-				for (Segment ls : w.segments) {
-					if (ls.deleted || ls.incomplete)
-						continue;
-					Point A = getPoint(ls.from.eastNorth);
-					Point B = getPoint(ls.to.eastNorth);
-					double c = A.distanceSq(B);
-					double a = p.distanceSq(B);
-					double b = p.distanceSq(A);
-					double perDist = a-(a-b+c)*(a-b+c)/4/c; // perpendicular distance squared
-					if (perDist < 100 && minDistanceSq > perDist && a < c+100 && b < c+100) {
-						minDistanceSq = perDist;
-						minPrimitive = w;
-					}
-				}			
-			}
-			if (minPrimitive != null)
-				return minPrimitive;
-		}
-		
-		minDistanceSq = Double.MAX_VALUE;
+				Point A = getPoint(ls.from.eastNorth);
+				Point B = getPoint(ls.to.eastNorth);
+				double c = A.distanceSq(B);
+				double a = p.distanceSq(B);
+				double b = p.distanceSq(A);
+				double perDist = a-(a-b+c)*(a-b+c)/4/c; // perpendicular distance squared
+				if (perDist < 100 && minDistanceSq > perDist && a < c+100 && b < c+100) {
+					minDistanceSq = perDist;
+					minPrimitive = w;
+				}
+			}			
+		}
+		return minPrimitive;
+	}
+
+	/**
+	 * @return the nearest segment to the screen point given.
+	 */
+	public final Segment getNearestSegment(Point p) {
+		Segment minPrimitive = null;
+		double minDistanceSq = Double.MAX_VALUE;
 		// segments
 		for (Segment ls : Main.ds.segments) {
@@ -185,6 +171,37 @@
 			}
 		}
-	
 		return minPrimitive;
+    }
+
+	/**
+	 * Return the object, that is nearest to the given screen point.
+	 * 
+	 * First, a node will be searched. If a node within 10 pixel is found, the
+	 * nearest node is returned.
+	 * 
+	 * If no node is found, search for pending segments.
+	 * 
+	 * If no such segment is found, and a non-pending segment is 
+	 * within 10 pixel to p, this segment is returned, except when 
+	 * <code>wholeWay</code> is <code>true</code>, in which case the 
+	 * corresponding Way is returned.
+	 * 
+	 * If no segment is found and the point is within an area, return that
+	 * area.
+	 * 
+	 * If no area is found, return <code>null</code>.
+	 * 
+	 * @param p				 The point on screen.
+	 * @param segmentInsteadWay Whether the segment (true) or only the whole
+	 * 					 	 way should be returned.
+	 * @return	The primitive, that is nearest to the point p.
+	 */
+	public OsmPrimitive getNearest(Point p, boolean segmentInsteadWay) {
+		OsmPrimitive osm = getNearestNode(p);
+		if (osm == null && !segmentInsteadWay)
+			osm = getNearestWay(p);
+		if (osm == null)
+			osm = getNearestSegment(p);
+		return osm;
 	}
 
@@ -243,5 +260,5 @@
 		return c;
 	}
-	
+
 	/**
 	 * @return The projection to be used in calculating stuff.
Index: src/org/openstreetmap/josm/gui/PreferenceDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/PreferenceDialog.java	(revision 92)
+++ src/org/openstreetmap/josm/gui/PreferenceDialog.java	(revision 93)
@@ -72,8 +72,9 @@
 				pwd = null;
 			Main.pref.put("osm-server.password", pwd);
-			Main.pref.put("wmsServerBaseUrl", wmsServerBaseUrl.getText());
-			Main.pref.put("csvImportString", csvImportString.getText());
-			Main.pref.put("drawRawGpsLines", drawRawGpsLines.isSelected());
-			Main.pref.put("forceRawGpsLines", forceRawGpsLines.isSelected());
+			Main.pref.put("wms.baseurl", wmsServerBaseUrl.getText());
+			Main.pref.put("csv.importstring", csvImportString.getText());
+			Main.pref.put("draw.rawgps.lines", drawRawGpsLines.isSelected());
+			Main.pref.put("draw.rawgps.lines.force", forceRawGpsLines.isSelected());
+			Main.pref.put("draw.segment.direction", directionHint.isSelected());
 
 			for (int i = 0; i < colors.getRowCount(); ++i) {
@@ -154,5 +155,5 @@
 	 */
 	private JCheckBox forceRawGpsLines = new JCheckBox("Force lines if no segments imported.");
-
+	private JCheckBox directionHint = new JCheckBox("Draw Direction Arrows");
 	private JTable colors;
 
@@ -200,5 +201,4 @@
 		});
 
-		// drawRawGpsLines
 		drawRawGpsLines.addActionListener(new ActionListener(){
 			public void actionPerformed(ActionEvent e) {
@@ -212,10 +212,12 @@
 		osmDataUsername.setText(Main.pref.get("osm-server.username"));
 		osmDataPassword.setText(Main.pref.get("osm-server.password"));
-		wmsServerBaseUrl.setText(Main.pref.get("wmsServerBaseUrl", "http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&width=512&height=512&layers=global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg&"));
-		csvImportString.setText(Main.pref.get("csvImportString"));
-		drawRawGpsLines.setSelected(Main.pref.getBoolean("drawRawGpsLines"));
+		wmsServerBaseUrl.setText(Main.pref.get("wms.baseurl", "http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&width=512&height=512&layers=global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg&"));
+		csvImportString.setText(Main.pref.get("csv.importstring"));
+		drawRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines"));
 		forceRawGpsLines.setToolTipText("Force drawing of lines if the imported data contain no line information.");
-		forceRawGpsLines.setSelected(Main.pref.getBoolean("forceRawGpsLines"));
+		forceRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines.force"));
 		forceRawGpsLines.setEnabled(drawRawGpsLines.isSelected());
+		directionHint.setToolTipText("Draw direction hints for all segments.");
+		directionHint.setSelected(Main.pref.getBoolean("draw.segment.direction"));
 
 
@@ -292,4 +294,5 @@
 		display.add(drawRawGpsLines, GBC.eol().insets(20,0,0,0));
 		display.add(forceRawGpsLines, GBC.eop().insets(40,0,0,0));
+		display.add(directionHint, GBC.eop().insets(20,0,0,0));
 		display.add(new JLabel("Colors"), GBC.eol());
 		colors.setPreferredScrollableViewportSize(new Dimension(100,112));
Index: src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 92)
+++ src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 93)
@@ -12,7 +12,7 @@
 import java.io.IOException;
 import java.io.Reader;
-import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.net.URLConnection;
 import java.util.Collection;
 import java.util.LinkedList;
@@ -72,5 +72,5 @@
 			sel = mode != SearchMode.remove ? new LinkedList<OsmPrimitive>() : Main.ds.allNonDeletedPrimitives();
 			try {
-		        HttpURLConnection con = (HttpURLConnection)url.openConnection();
+		        URLConnection con = url.openConnection();
 		        Reader in = new ProgressReader(con, progress);
 				currentAction.setText("Downloading...");
@@ -227,6 +227,6 @@
 
 	public static void search(String search, SearchMode mode) {
-	    if (search.startsWith("http://")) {
-	    	SelectionWebsiteLoader loader = new SelectionWebsiteLoader(search, mode);
+		if (search.startsWith("http://") || search.startsWith("ftp://") || search.startsWith("https://") || search.startsWith("file:/")) {
+			SelectionWebsiteLoader loader = new SelectionWebsiteLoader(search, mode);
 	    	if (loader.url != null) {
 	    		Main.worker.execute(loader);
Index: src/org/openstreetmap/josm/io/ProgressReader.java
===================================================================
--- src/org/openstreetmap/josm/io/ProgressReader.java	(revision 92)
+++ src/org/openstreetmap/josm/io/ProgressReader.java	(revision 93)
@@ -4,5 +4,5 @@
 import java.io.InputStreamReader;
 import java.io.Reader;
-import java.net.HttpURLConnection;
+import java.net.URLConnection;
 
 import javax.swing.BoundedRangeModel;
@@ -17,5 +17,5 @@
 	private final BoundedRangeModel progress;
 
-	public ProgressReader(HttpURLConnection con, BoundedRangeModel progress) throws IOException {
+	public ProgressReader(URLConnection con, BoundedRangeModel progress) throws IOException {
 		this.in = new InputStreamReader(con.getInputStream());
 		this.progress = progress;
Index: src/org/openstreetmap/josm/io/RawCsvReader.java
===================================================================
--- src/org/openstreetmap/josm/io/RawCsvReader.java	(revision 92)
+++ src/org/openstreetmap/josm/io/RawCsvReader.java	(revision 93)
@@ -31,5 +31,5 @@
 	public Collection<GpsPoint> parse() throws JDOMException, IOException {
 		Collection<GpsPoint> data = new LinkedList<GpsPoint>();
-		String formatStr = Main.pref.get("csvImportString");
+		String formatStr = Main.pref.get("csv.importstring");
 		if (formatStr == null)
 			formatStr = in.readLine();
@@ -53,5 +53,5 @@
 		// test for completness
 		if (!format.contains("lat") || !format.contains("lon")) {
-			if (Main.pref.get("csvImportString").equals(""))
+			if (Main.pref.get("csv.importstring").equals(""))
 				throw new JDOMException("Format string in data is incomplete or not found. Try setting an manual format string in Preferences.");
 			throw new JDOMException("Format string is incomplete. Need at least 'lat' and 'lon' specification");
@@ -75,5 +75,5 @@
 						st.nextToken();
 					else
-						throw new JDOMException("Unknown data type: '"+token+"'."+(Main.pref.get("csvImportString").equals("") ? " Maybe add an format string in preferences." : ""));
+						throw new JDOMException("Unknown data type: '"+token+"'."+(Main.pref.get("csv.importstring").equals("") ? " Maybe add an format string in preferences." : ""));
 				}
 				data.add(new GpsPoint(new LatLon(lat, lon), time));
Index: src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 92)
+++ src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 93)
@@ -28,10 +28,10 @@
 	 */
 	public static enum OverlayPosition {NORTHWEST, NORTHEAST, SOUTHWEST, SOUTHEAST}
-	
+
 	/**
 	 * The icon cache
 	 */
 	private static Map<URL, Image> cache = new HashMap<URL, Image>();
-	
+
 	/**
 	 * Return an image from the specified location.
@@ -44,5 +44,5 @@
 		if (subdir != "")
 			subdir += "/";
-        String ext = name.indexOf('.') != -1 ? "" : ".png";
+		String ext = name.indexOf('.') != -1 ? "" : ".png";
 		URL path = Main.class.getResource("/images/"+subdir+name+ext);
 		if (path == null)
