Index: /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java	(revision 30612)
+++ /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java	(revision 30613)
@@ -38,8 +38,6 @@
 import org.openstreetmap.josm.tools.GBC;
 
-
 /**
  * The HouseNumberInputDialog is the layout of the house number input logic.
- * Created with the Eclipse Visual Editor.
  *
  *  This dialog is concerned with the layout, all logic goes into the
@@ -47,5 +45,4 @@
  *
  * @author casualwalker
- *
  */
 public class HouseNumberInputDialog extends ExtendedDialog {
@@ -207,15 +204,10 @@
                 inputPanel.add(new JLabel(tr("Street name: ")+"\""+streetName+"\""), GBC.eol().insets(3,3,0,0));
             }
-            if (buildingType == null) {
-                inputPanel.add(buildingLabel, GBC.std().insets(3,3,0,0));
-                inputPanel.add(getBuilding(), GBC.eol().insets(5,3,0,0));
-            } else {
-                inputPanel.add(new JLabel(tr("Building: ")+"\""+buildingType+"\""), GBC.eol().insets(3,3,0,0));
-            }
+            inputPanel.add(buildingLabel, GBC.std().insets(3,3,0,0));
+            inputPanel.add(getBuilding(), GBC.eol().insets(5,3,0,0));
             inputPanel.add(handleRelationCheckBox, GBC.eol().insets(3,3,0,0));
             inputPanel.add(deleteOutlineCheckBox, GBC.eol().insets(3,3,0,0));
             
-            if (numbers.isVisible())
-            {
+            if (numbers.isVisible()) {
                 loLabel.setVisible(false);
                 lo.setVisible(false);
@@ -237,6 +229,6 @@
      * Overrides the default actions. Will not close the window when upload trace is clicked
      */
-    @Override protected void buttonAction(int buttonIndex, final ActionEvent evt) {
-        //String a = evt.getActionCommand();
+    @Override
+    protected void buttonAction(int buttonIndex, final ActionEvent evt) {
         this.inputHandler.actionPerformed(evt);
     }
@@ -309,5 +301,4 @@
             streetComboBox.setEditable(true);
             streetComboBox.setSelectedItem(null);
-
         }
         return streetComboBox;
@@ -327,6 +318,9 @@
             buildingComboBox.setPossibleACItems(values);
             buildingComboBox.setEditable(true);
-            buildingComboBox.setSelectedItem("yes");
-
+            if (buildingType != null && !buildingType.isEmpty()) {
+                buildingComboBox.setSelectedItem(buildingType);
+            } else {
+                buildingComboBox.setSelectedItem("yes");
+            }
         }
         return buildingComboBox;
@@ -361,5 +355,4 @@
                 interpolation.select(tr("Even/Odd"));
             }
-            //return (dialog.interpolation.getSelectedItem().equals(tr("All"))) ? 1 : 2;
         }
         return interpolation;
Index: /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java	(revision 30612)
+++ /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java	(revision 30613)
@@ -394,7 +394,4 @@
      */
     public String buildingType() {
-        if (buildingType != null)
-            return buildingType;
-
         return getItemText(dialog.buildingComboBox);
     }
Index: /applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 30612)
+++ /applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 30613)
@@ -97,4 +97,10 @@
     }
     
+    private static final class InvalidUserInputException extends Exception {
+        InvalidUserInputException(String message) {
+            super(message);
+        }
+    }
+
     /**
      * Checks that the selection is OK. If not, displays error message. If so
@@ -110,14 +116,4 @@
         Node init = null;
 
-        class InvalidUserInputException extends Exception {
-            /*InvalidUserInputException(String message) {
-                super(message);
-            }*/
-
-            InvalidUserInputException() {
-                super();
-            }
-        }
-
         try {
             if (sel.size() == 1) {
@@ -125,5 +121,5 @@
 
                 if (!(prim instanceof Way))
-                    throw new InvalidUserInputException();
+                    throw new InvalidUserInputException(prim+" is not a way");
 
                 outline = (Way) prim;
@@ -136,20 +132,20 @@
                         if (outline != null)
                             // already have a building
-                            throw new InvalidUserInputException();
+                            throw new InvalidUserInputException("already have a building");
                         outline = way;
                     } else if (way.hasKey("highway")) {
                         if (street != null)
                             // already have a street
-                            throw new InvalidUserInputException();
+                            throw new InvalidUserInputException("already have a street");
                         street = way;
-
-                        if ((streetname = street.get("name")) == null)
-                            throw new InvalidUserInputException();
+                        streetname = street.get("name");
+                        if (streetname == null)
+                            throw new InvalidUserInputException("street does not have any name");
                     } else
-                        throw new InvalidUserInputException();
+                        throw new InvalidUserInputException(way+" is neither a building nor a highway");
                 }
 
                 if (outline == null)
-                    throw new InvalidUserInputException();
+                    throw new InvalidUserInputException("no outline way found");
 
                 List<Node> nodes = OsmPrimitive.getFilteredList(sel, Node.class);
@@ -160,12 +156,12 @@
                     Node node = nit.next();
                     if (node.hasKey("addr:housenumber")) {
-                        String nodesstreetname = node.get("addr:street");
+                        String nodesStreetName = node.get("addr:street");
                         // if a node has a street name if must be equal
                         // to the one of the other address nodes
-                        if (nodesstreetname != null) {
+                        if (nodesStreetName != null) {
                             if (streetname == null)
-                                streetname = nodesstreetname;
-                            else if (!nodesstreetname.equals(streetname))
-                                throw new InvalidUserInputException();
+                                streetname = nodesStreetName;
+                            else if (!nodesStreetName.equals(streetname))
+                                throw new InvalidUserInputException("addr:street does not match street name");
                         }
 
@@ -176,5 +172,5 @@
                         // the number direction right.
                         if (!outline.containsNode(node) || init != null)
-                            throw new InvalidUserInputException();
+                            throw new InvalidUserInputException("node problem");
                         init = node;
                     }
@@ -185,6 +181,8 @@
 
             if (outline == null || !outline.isClosed() || outline.getNodesCount() < 5)
-                throw new InvalidUserInputException();
+                throw new InvalidUserInputException("wrong or missing outline");
+        
         } catch (InvalidUserInputException ex) {
+            Main.warn("Terracer: "+ex.getMessage());
             new ExtendedDialog(Main.parent, tr("Invalid selection"), new String[] {"OK"})
                 .setButtonIcons(new String[] {"ok"}).setIcon(JOptionPane.INFORMATION_MESSAGE)
@@ -211,5 +209,5 @@
             if (associatedStreets.size() > 1) {
                 // TODO: Deal with multiple associated Streets
-                System.out.println("Terracer warning: Found "+associatedStreets.size()+" associatedStreet relations. Considering the first one only.");
+                Main.warn("Terracer: Found "+associatedStreets.size()+" associatedStreet relations. Considering the first one only.");
             }
         }
@@ -233,5 +231,5 @@
             String title = trn("Change {0} object", "Change {0} objects", sel.size(), sel.size());
             // show input dialog.
-            new HouseNumberInputHandler(this, outline, init, street, streetname, null,
+            new HouseNumberInputHandler(this, outline, init, street, streetname, outline.get("building"),
                     associatedStreet, housenumbers, title);
         }
@@ -522,5 +520,5 @@
             numberAdded = houseNum.hasKey("addr:housenumber");
         }
-        if (!outline.hasKey("building") && !buildingAdded) {
+        if (!buildingAdded && buildingValue != null && !buildingValue.isEmpty()) {
             this.commands.add(new ChangePropertyCommand(outline, "building", buildingValue));
         }
