Index: src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java
===================================================================
--- src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java	(revision 59)
+++ src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java	(revision 60)
@@ -188,4 +188,6 @@
 	private boolean match(Track t1, Track t2) {
 		if (t1.id == 0 || t2.id == 0) {
+			if (t1.segments.size() != t2.segments.size())
+				return false;
 			Iterator<LineSegment> it = t1.segments.iterator();
 			for (LineSegment ls : t2.segments)
Index: src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmReader.java	(revision 59)
+++ src/org/openstreetmap/josm/io/OsmReader.java	(revision 60)
@@ -80,4 +80,5 @@
 				n.coor = new GeoPoint(getDouble(atts, "lat"), getDouble(atts, "lon"));
 				current = n;
+				readCommon(atts);
 				current.id = getLong(atts, "id");
 				nodes.put(n.id, n);
@@ -86,9 +87,9 @@
 						nodes.get(getLong(atts, "from")), 
 						nodes.get(getLong(atts, "to")));
-				current.id = getLong(atts, "id");
+				readCommon(atts);
 				lineSegments.put(current.id, (LineSegment)current);
 			} else if (qName.equals("way")) {
 				current = new Track();
-				current.id = getLong(atts, "id");
+				readCommon(atts);
 			} else if (qName.equals("seg")) {
 				if (current instanceof Track)
@@ -102,4 +103,21 @@
 			throw new SAXException("NullPointerException. Possible some missing tags.", x);
 		}
+	}
+
+	/**
+	 * Read out the common attributes from atts and put them into this.current.
+	 */
+	private void readCommon(Attributes atts) {
+		current.id = getLong(atts, "id");
+		String action = atts.getValue("action");
+		if ("delete".equals(action))
+			current.setDeleted(true);
+		else if ("modify".equals(action)) {
+			current.modified = true;
+			current.modifiedProperties = true;
+		} else if ("modify/object".equals(action))
+			current.modified = true;
+		else if ("modify/property".equals(action))
+			current.modifiedProperties = true;
 	}
 
