Index: /src/org/openstreetmap/josm/actions/SaveAction.java
===================================================================
--- /src/org/openstreetmap/josm/actions/SaveAction.java	(revision 38)
+++ /src/org/openstreetmap/josm/actions/SaveAction.java	(revision 39)
@@ -48,8 +48,17 @@
 		try {
 			FileWriter fileWriter = new FileWriter(file);
-			if (file.getName().endsWith(".gpx"))
+			String fn = file.getName();
+			if (fn.endsWith(".gpx"))
 				new GpxWriter(fileWriter).output();
-			else
+			else if (fn.endsWith(".xml") || fn.endsWith(".osm"))
 				new OsmWriter(fileWriter, Main.main.ds).output();
+			else if (fn.endsWith(".txt") || fn.endsWith(".csv")) {
+				JOptionPane.showMessageDialog(Main.main, "CSV output not supported yet.");
+				return;
+			} else {
+				JOptionPane.showMessageDialog(Main.main, "Unknown file extension.");
+				return;
+			}
+				
 			fileWriter.close();
 		} catch (IOException e) {
Index: /src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java
===================================================================
--- /src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java	(revision 38)
+++ /src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java	(revision 39)
@@ -79,5 +79,5 @@
 			return;
 
-		OsmPrimitive clicked = mv.getNearest(e.getPoint(), false);
+		OsmPrimitive clicked = mv.getNearest(e.getPoint(), true);
 		if (clicked == null || !(clicked instanceof Node))
 			return;
Index: /src/org/openstreetmap/josm/data/projection/Mercator.java
===================================================================
--- /src/org/openstreetmap/josm/data/projection/Mercator.java	(revision 38)
+++ /src/org/openstreetmap/josm/data/projection/Mercator.java	(revision 39)
@@ -9,5 +9,5 @@
  * from wikipedia.
  * 
- * The center of the mercator projection is always the 0° 
+ * The center of the mercator projection is always the 0 grad 
  * coordinate.
  * 
Index: /src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MapStatus.java	(revision 38)
+++ /src/org/openstreetmap/josm/gui/MapStatus.java	(revision 39)
@@ -2,4 +2,5 @@
 
 import java.awt.AWTEvent;
+import java.awt.Cursor;
 import java.awt.Font;
 import java.awt.GridBagLayout;
@@ -8,4 +9,5 @@
 import java.awt.event.AWTEventListener;
 import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseMotionListener;
@@ -23,4 +25,5 @@
 import javax.swing.PopupFactory;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.GeoPoint;
 import org.openstreetmap.josm.data.osm.Key;
@@ -120,8 +123,8 @@
 					
 					JPanel c = new JPanel(new GridBagLayout());
-					for (OsmPrimitive osm : osms) {
+					for (final OsmPrimitive osm : osms) {
 						SelectionComponentVisitor visitor = new SelectionComponentVisitor();
 						osm.visit(visitor);
-						StringBuilder text = new StringBuilder("<html>");
+						final StringBuilder text = new StringBuilder();
 						if (osm.id == 0 || osm.modified || osm.modifiedProperties)
 							visitor.name = "<i><b>"+visitor.name+"*</b></i>";
@@ -132,7 +135,24 @@
 							for (Entry<Key, String> e : osm.keys.entrySet())
 								text.append("<br>"+e.getKey().name+"="+e.getValue());
-						JLabel l = new JLabel(text.toString()+"</html>", visitor.icon, JLabel.HORIZONTAL);
+						final JLabel l = new JLabel("<html>"+text.toString()+"</html>", visitor.icon, JLabel.HORIZONTAL);
 						l.setFont(l.getFont().deriveFont(Font.PLAIN));
 						l.setVerticalTextPosition(JLabel.TOP);
+						l.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+						l.addMouseListener(new MouseAdapter(){
+							@Override
+							public void mouseEntered(MouseEvent e) {
+								l.setText("<html><u color='blue'>"+text.toString()+"</u></html>");
+							}
+							@Override
+							public void mouseExited(MouseEvent e) {
+								l.setText("<html>"+text.toString()+"</html>");
+							}
+							@Override
+							public void mouseClicked(MouseEvent e) {
+								Main.main.ds.clearSelection();
+								osm.setSelected(true);
+								mv.repaint();
+							}
+						});
 						c.add(l, GBC.eol());
 					}
Index: /src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MapView.java	(revision 38)
+++ /src/org/openstreetmap/josm/gui/MapView.java	(revision 39)
@@ -234,10 +234,10 @@
 	 * If no area is found, return <code>null</code>.
 	 * 
-	 * @param p				The point on screen.
-	 * @param wholeTrack	Whether the whole track or only the line segment
-	 * 					 	should be returned.
+	 * @param p				 The point on screen.
+	 * @param lsInsteadTrack Whether the line segment (true) or only the whole
+	 * 					 	 track should be returned.
 	 * @return	The primitive, that is nearest to the point p.
 	 */
-	public OsmPrimitive getNearest(Point p, boolean wholeTrack) {
+	public OsmPrimitive getNearest(Point p, boolean lsInsteadTrack) {
 		double minDistanceSq = Double.MAX_VALUE;
 		OsmPrimitive minPrimitive = null;
@@ -245,4 +245,6 @@
 		// nodes
 		for (Node n : Main.main.ds.nodes) {
+			if (n.isDeleted())
+				continue;
 			Point sp = getScreenPoint(n.coor);
 			double dist = p.distanceSq(sp);
@@ -257,7 +259,11 @@
 		// for whole tracks, try the tracks first
 		minDistanceSq = Double.MAX_VALUE;
-		if (wholeTrack) {
+		if (!lsInsteadTrack) {
 			for (Track t : Main.main.ds.tracks) {
+				if (t.isDeleted())
+					continue;
 				for (LineSegment ls : t.segments) {
+					if (ls.isDeleted())
+						continue;
 					Point A = getScreenPoint(ls.start.coor);
 					Point B = getScreenPoint(ls.end.coor);
@@ -279,4 +285,6 @@
 		// line segments
 		for (LineSegment ls : Main.main.ds.lineSegments) {
+			if (ls.isDeleted())
+				continue;
 			Point A = getScreenPoint(ls.start.coor);
 			Point B = getScreenPoint(ls.end.coor);
@@ -313,5 +321,5 @@
 	 */
 	public Collection<OsmPrimitive> getAllNearest(Point p) {
-		OsmPrimitive osm = getNearest(p, false);
+		OsmPrimitive osm = getNearest(p, true);
 		if (osm == null)
 			return null;
@@ -321,9 +329,9 @@
 			Node node = (Node)osm;
 			for (Node n : Main.main.ds.nodes)
-				if (n.coor.equalsLatLon(node.coor))
+				if (!n.isDeleted() && n.coor.equalsLatLon(node.coor))
 					c.add(n);
 			for (LineSegment ls : Main.main.ds.lineSegments)
 				// line segments never match nodes, so they are skipped by contains
-				if (c.contains(ls.start) || c.contains(ls.end))
+				if (!ls.isDeleted() && (c.contains(ls.start) || c.contains(ls.end)))
 					c.add(ls);
 		} 
@@ -331,11 +339,13 @@
 			LineSegment line = (LineSegment)osm;
 			for (LineSegment ls : Main.main.ds.lineSegments)
-				if (ls.equalPlace(line))
+				if (!ls.isDeleted() && ls.equalPlace(line))
 					c.add(ls);
 		}
 		if (osm instanceof Node || osm instanceof LineSegment) {
 			for (Track t : Main.main.ds.tracks) {
+				if (t.isDeleted())
+					continue;
 				for (LineSegment ls : t.segments) {
-					if (c.contains(ls)) {
+					if (!ls.isDeleted() && c.contains(ls)) {
 						c.add(t);
 						break;
Index: /src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 38)
+++ /src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 39)
@@ -6,4 +6,6 @@
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.util.Collection;
 
@@ -48,4 +50,12 @@
 		displaylist.setCellRenderer(new OsmPrimitivRenderer());
 		displaylist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+		displaylist.addMouseListener(new MouseAdapter(){
+			@Override
+			public void mouseClicked(MouseEvent e) {
+				if (e.getClickCount() < 2)
+					return;
+				updateMap();
+			}
+		});
 
 		add(new JScrollPane(displaylist), BorderLayout.CENTER);
Index: /src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- /src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 38)
+++ /src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 39)
@@ -81,4 +81,7 @@
 				osm.visit(visitor);
 		for (OsmPrimitive osm : data.nodes)
+			if (!osm.isDeleted())
+				osm.visit(visitor);
+		for (OsmPrimitive osm : data.getSelected())
 			if (!osm.isDeleted())
 				osm.visit(visitor);
Index: /src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- /src/org/openstreetmap/josm/io/OsmReader.java	(revision 38)
+++ /src/org/openstreetmap/josm/io/OsmReader.java	(revision 39)
@@ -118,4 +118,9 @@
 			}
 		}
+		
+		// clear all negative ids (new to this file)
+		for (OsmPrimitive osm : data.allPrimitives())
+			if (osm.id < 0)
+				osm.id = 0;
 
 		return data;
@@ -178,6 +183,4 @@
 		if (suid != null)
 			data.id = Long.parseLong(suid);
-		if (data.id < 0)
-			data.id = 0;
 		
 		String propStr = e.getAttributeValue("tags");
