Index: trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java	(revision 8177)
+++ trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java	(revision 8178)
@@ -83,15 +83,12 @@
                 if(!e.getKey().equals(k)) {
                     if(drop || !keys.containsKey(k)) {
-                        newKeys.remove(e.getKey());
+                        newKeys.put(e.getKey(), null);
                         if(!drop)
                             newKeys.put(k, v);
                     }
                 } else if(!e.getValue().equals(v)) {
-                    if(v.isEmpty())
-                        newKeys.remove(k);
-                    else
-                        newKeys.put(k, v);
+                    newKeys.put(k, v.isEmpty() ? null : v);
                 } else if (drop) {
-                    newKeys.remove(e.getKey());
+                    newKeys.put(e.getKey(), null);
                 }
             }
@@ -129,5 +126,8 @@
             if(keys.containsKey(oldKey) && !keys.containsKey(newKey)) {
                 keys.put(newKey, keys.get(oldKey));
-                keys.remove(oldKey);
+                keys.put(oldKey, null);
+                return true;
+            } else if(keys.containsKey(oldKey) && keys.containsKey(newKey) && keys.get(oldKey).equals(keys.get(newKey))) {
+                keys.put(oldKey, null);
                 return true;
             }
@@ -169,5 +169,5 @@
                 keys.put(newKey, newValue);
                 if(!newKey.equals(oldKey))
-                    keys.remove(oldKey);
+                    keys.put(oldKey, null);
                 return true;
             }
@@ -189,5 +189,5 @@
 
         for (OsmPrimitive osm : objectsToUpload) {
-            Map<String, String> keys = osm.getKeys();
+            HashMap<String, String> keys = new HashMap<>(osm.getKeys());
             if(!keys.isEmpty()) {
                 boolean modified = false;
@@ -197,5 +197,5 @@
                 }
                 if(modified)
-                    cmds.add(new ChangePropertyCommand(Collections.singleton(osm), new HashMap<>(keys)));
+                    cmds.add(new ChangePropertyCommand(Collections.singleton(osm), keys));
             }
         }
