Index: applications/editors/josm/plugins/terracer/build.xml
===================================================================
--- applications/editors/josm/plugins/terracer/build.xml	(revision 33607)
+++ applications/editors/josm/plugins/terracer/build.xml	(revision 33608)
@@ -2,5 +2,5 @@
 <project name="terracer" default="dist" basedir=".">
     <property name="commit.message" value="applied #j5760 (patch by robome) - Order of housenumbers not correct"/>
-    <property name="plugin.main.version" value="12678"/>
+    <property name="plugin.main.version" value="12859"/>
     <property name="plugin.author" value="Matt Amos"/>
     <property name="plugin.class" value="terracer.TerracerPlugin"/>
Index: applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java
===================================================================
--- applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java	(revision 33607)
+++ applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java	(revision 33608)
@@ -27,8 +27,10 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
+import org.openstreetmap.josm.data.tagging.ac.AutoCompletionSet;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox;
-import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
+import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
 import org.openstreetmap.josm.gui.util.WindowGeometry;
 import org.openstreetmap.josm.tools.GBC;
@@ -311,9 +313,6 @@
 
         if (buildingComboBox == null) {
-            final List<AutoCompletionListItem> values = MainApplication
-                .getLayerManager().getEditDataSet().getAutoCompletionManager().getValues("building");
-
             buildingComboBox = new AutoCompletingComboBox();
-            buildingComboBox.setPossibleACItems(values);
+            buildingComboBox.setPossibleAcItems(AutoCompletionManager.of(Main.main.getEditDataSet()).getTagValues("building"));
             buildingComboBox.setEditable(true);
             if (buildingType != null && !buildingType.isEmpty()) {
Index: applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java
===================================================================
--- applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java	(revision 33607)
+++ applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java	(revision 33608)
@@ -24,6 +24,6 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox;
-import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.UserCancelException;
@@ -391,6 +391,6 @@
         } else {
             String name;
-            if (selected instanceof AutoCompletionListItem) {
-               name = ((AutoCompletionListItem) selected).getValue();
+            if (selected instanceof AutoCompletionItem) {
+               name = ((AutoCompletionItem) selected).getValue();
             } else {
                name = selected.toString();
Index: applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java
===================================================================
--- applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 33607)
+++ applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 33608)
@@ -12,8 +12,10 @@
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
@@ -30,4 +32,5 @@
 import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -60,10 +63,5 @@
 public final class TerracerAction extends JosmAction {
 
-    // smsms1 asked for the last value to be remembered to make it easier to do
-    // repeated terraces. this is the easiest, but not necessarily nicest, way.
-    // private static String lastSelectedValue = "";
-
-    Collection<Command> commands;
-
+    private Collection<Command> commands;
     private Collection<OsmPrimitive> primitives;
     private TagCollection tagsInConflict;
@@ -347,4 +345,5 @@
         this.commands = new LinkedList<>();
         Collection<Way> ways = new LinkedList<>();
+        DataSet ds = getLayerManager().getEditDataSet();
 
         if (nb > 1) {
@@ -355,9 +354,9 @@
                 newNodes[1][i] = interpolateAlong(interp.b, backLength * iDir / nb);
                 if (!outline.containsNode(newNodes[0][i]))
-                    this.commands.add(new AddCommand(newNodes[0][i]));
+                    this.commands.add(new AddCommand(ds, newNodes[0][i]));
                 else
                     reusedNodes.add(newNodes[0][i]);
                 if (!outline.containsNode(newNodes[1][i]))
-                    this.commands.add(new AddCommand(newNodes[1][i]));
+                    this.commands.add(new AddCommand(ds, newNodes[1][i]));
                 else
                     reusedNodes.add(newNodes[1][i]);
@@ -388,5 +387,5 @@
                 if (createNewWay) {
                     ways.add(terr);
-                    this.commands.add(new AddCommand(terr));
+                    this.commands.add(new AddCommand(ds, terr));
                 } else {
                     ways.add(outline);
@@ -404,5 +403,5 @@
                 }
                 if (!nodesToDelete.isEmpty())
-                    this.commands.add(DeleteCommand.delete(MainApplication.getLayerManager().getEditLayer(), nodesToDelete));
+                    this.commands.add(DeleteCommand.delete(nodesToDelete));
             }
         } else {
@@ -415,6 +414,5 @@
         // Or should removing them also be an option?
         if (!housenumbers.isEmpty()) {
-            commands.add(DeleteCommand.delete(MainApplication.getLayerManager().getEditLayer(),
-                    housenumbers, true, true));
+            commands.add(DeleteCommand.delete(housenumbers, true, true));
         }
 
@@ -462,5 +460,5 @@
             associatedStreet.addMember(new RelationMember("house", w));
         }
-        this.commands.add(new AddCommand(associatedStreet));
+        this.commands.add(new AddCommand(getLayerManager().getEditDataSet(), associatedStreet));
     }
 
@@ -514,4 +512,5 @@
         boolean buildingAdded = false;
         boolean numberAdded = false;
+        Map<String, String> tags = new HashMap<>();
         if (houseNum != null) {
             primitives = Arrays.asList(new OsmPrimitive[]{houseNum, outline});
@@ -522,5 +521,5 @@
 
             for (Tag tag : tagsToCopy) {
-                this.commands.add(new ChangePropertyCommand(outline, tag.getKey(), tag.getValue()));
+                tags.put(tag.getKey(), tag.getValue());
             }
 
@@ -529,16 +528,19 @@
         }
         if (!buildingAdded && buildingValue != null && !buildingValue.isEmpty()) {
-            this.commands.add(new ChangePropertyCommand(outline, "building", buildingValue));
+            tags.put("building", buildingValue);
         }
         if (defaultNumber != null && !numberAdded) {
-            this.commands.add(new ChangePropertyCommand(outline, "addr:housenumber", defaultNumber));
+            tags.put("addr:housenumber", defaultNumber);
         }
         // Only put addr:street if no relation exists or if it has no name
         if (associatedStreet == null || !associatedStreet.hasKey("name")) {
             if (street != null) {
-                this.commands.add(new ChangePropertyCommand(outline, "addr:street", street.get("name")));
+                tags.put("addr:street", street.get("name"));
             } else if (streetName != null && !streetName.trim().isEmpty()) {
-                this.commands.add(new ChangePropertyCommand(outline, "addr:street", streetName.trim()));
-            }
+                tags.put("addr:street", streetName.trim());
+            }
+        }
+        if (!tags.isEmpty()) {
+            commands.add(new ChangePropertyCommand(getLayerManager().getEditDataSet(), Collections.singleton(outline), tags));
         }
     }
