Index: applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
===================================================================
--- applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java	(revision 23294)
+++ applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java	(revision 23295)
@@ -383,48 +383,21 @@
 			type = keys.get("seamark:type"); //$NON-NLS-1$
 
-		if (type.equals("buoy_lateral") || type.equals("beacon_lateral") //$NON-NLS-1$ //$NON-NLS-2$
-				|| keys.containsKey("seamark:buoy_lateral:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_lateral:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_lateral:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_lateral:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_lateral:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_lateral:colour")) { //$NON-NLS-1$
+		if (type.equals("buoy_lateral") || type.equals("beacon_lateral")) { //$NON-NLS-1$ //$NON-NLS-2$
 			buoy = new BuoyLat(this, node);
 			return;
 
-		} else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal") //$NON-NLS-1$ //$NON-NLS-2$
-				|| keys.containsKey("seamark:buoy_cardinal:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_cardinal:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_cardinal:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_cardinal:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_cardinal:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_cardinal:colour")) { //$NON-NLS-1$
+		} else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal")) { //$NON-NLS-1$ //$NON-NLS-2$
 			buoy = new BuoyCard(this, node);
 			return;
 
-		} else if (type.equals("buoy_safe_water") //$NON-NLS-1$
-				|| type.equals("beacon_safe_water") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_safe_water:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_safe_water:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_safe_water:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_safe_water:colour")) { //$NON-NLS-1$
+		} else if (type.equals("buoy_safe_water") || type.equals("beacon_safe_water")) { //$NON-NLS-1$
 			buoy = new BuoySaw(this, node);
 			return;
 
-		} else if (type.equals("buoy_special_purpose") //$NON-NLS-1$
-				|| type.equals("beacon_special_purpose") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_special_purpose:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_special_purpose:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_special_purpose:colour")) { //$NON-NLS-1$
+		} else if (type.equals("buoy_special_purpose") || type.equals("beacon_special_purpose")) { //$NON-NLS-1$
 			buoy = new BuoySpec(this, node);
 			return;
 
-		} else if (type.equals("buoy_isolated_danger") //$NON-NLS-1$
-				|| type.equals("beacon_isolated_danger") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_isolated_danger:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_isolated_danger:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_isolated_danger:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_isolated_danger:colour")) { //$NON-NLS-1$
+		} else if (type.equals("buoy_isolated_danger") || type.equals("beacon_isolated_danger")) { //$NON-NLS-1$
 			buoy = new BuoyIsol(this, node);
 			return;
@@ -470,4 +443,55 @@
 				}
 			}
+		}
+
+		if (keys.containsKey("buoy_lateral:category") || keys.containsKey("beacon_lateral:category")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyLat(this, node);
+			return;
+		} else if (keys.containsKey("buoy_cardinal:category") || keys.containsKey("beacon_cardinal:category")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyCard(this, node);
+			return;
+		} else if (keys.containsKey("buoy_isolated_danger:category") || keys.containsKey("beacon_isolated_danger:category")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyIsol(this, node);
+			return;
+		} else if (keys.containsKey("buoy_safe_water:category") || keys.containsKey("beacon_safe_water:category")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoySaw(this, node);
+			return;
+		} else if (keys.containsKey("buoy_special_purpose:category") || keys.containsKey("beacon_special_purpose:category")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoySpec(this, node);
+			return;
+		}
+
+		if (keys.containsKey("buoy_lateral:shape") || keys.containsKey("beacon_lateral:shape")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyLat(this, node);
+			return;
+		} else if (keys.containsKey("buoy_cardinal:shape") || keys.containsKey("beacon_cardinal:shape")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyCard(this, node);
+			return;
+		} else if (keys.containsKey("buoy_isolated_danger:shape") || keys.containsKey("beacon_isolated_danger:shape")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyIsol(this, node);
+			return;
+		} else if (keys.containsKey("buoy_safe_water:shape") || keys.containsKey("beacon_safe_water:shape")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoySaw(this, node);
+			return;
+		} else if (keys.containsKey("buoy_special_purpose:shape") || keys.containsKey("beacon_special_purpose:shape")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoySpec(this, node);
+			return;
+		}
+
+		if (keys.containsKey("buoy_lateral:colour") || keys.containsKey("beacon_lateral:colour")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyLat(this, node);
+			return;
+		} else if (keys.containsKey("buoy_cardinal:colour") || keys.containsKey("beacon_cardinal:colour")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyCard(this, node);
+			return;
+		} else if (keys.containsKey("buoy_isolated_danger:colour") || keys.containsKey("beacon_isolated_danger:colour")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoyIsol(this, node);
+			return;
+		} else if (keys.containsKey("buoy_safe_water:colour") || keys.containsKey("beacon_safe_water:colour")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoySaw(this, node);
+			return;
+		} else if (keys.containsKey("buoy_special_purpose:colour") || keys.containsKey("beacon_special_purpose:colour")) { //$NON-NLS-1$ //$NON-NLS-2$
+			buoy = new BuoySpec(this, node);
+			return;
 		}
 
@@ -877,17 +901,7 @@
 			cbM01CatOfMark.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
-					int cat = cbM01CatOfMark.getSelectedIndex();
-
-					if (buoy == null) {
-						buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$
-						buoy.paintSign();
-						return;
-					}
-
-					Node n = buoy.getNode();
-					if (n == null)
-						return;
-
-					buoy.setBuoyIndex(cat);
+					if (buoy == null)
+						return;
+					buoy.setBuoyIndex(cbM01CatOfMark.getSelectedIndex());
 					buoy.refreshStyles();
 					buoy.refreshLights();
@@ -907,11 +921,10 @@
 			cbM01StyleOfMark.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
-					int style = cbM01StyleOfMark.getSelectedIndex();
-					if (buoy != null && style != buoy.getStyleIndex()) {
-						buoy.setStyleIndex(style);
-						buoy.refreshLights();
-						buoy.setLightColour();
-						buoy.paintSign();
-					}
+					if (buoy == null)
+						return;
+					buoy.setStyleIndex(cbM01StyleOfMark.getSelectedIndex());
+					buoy.refreshLights();
+					buoy.setLightColour();
+					buoy.paintSign();
 				}
 			});
@@ -926,4 +939,6 @@
 			tfM01Name.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setName(tfM01Name.getText());
 					buoy.paintSign();
@@ -942,7 +957,6 @@
 			cM01TopMark.addItemListener(new ItemListener() {
 				public void itemStateChanged(ItemEvent e) {
-					if (buoy == null) {
-						return;
-					}
+					if (buoy == null)
+						return;
 					buoy.setTopMark(cM01TopMark.isSelected());
 					buoy.paintSign();
@@ -960,4 +974,6 @@
 			cbM01TopMark.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setTopMarkIndex(cbM01TopMark.getSelectedIndex());
 					buoy.paintSign();
@@ -976,4 +992,6 @@
 			cM01Radar.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					if (cM01Radar.isSelected()) {
 						buoy.setRadar(true);
@@ -998,4 +1016,6 @@
 			cM01Racon.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					if (cM01Racon.isSelected()) {
 						buoy.setRacon(true);
@@ -1024,4 +1044,6 @@
 			cbM01Racon.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					int rac = cbM01Racon.getSelectedIndex();
 					buoy.setRaType(rac);
@@ -1039,4 +1061,6 @@
 			tfM01Racon.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setRaconGroup(tfM01Racon.getText().trim());
 					buoy.paintSign();
@@ -1055,4 +1079,6 @@
 			cM01Fog.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setFog(cM01Fog.isSelected());
 					buoy.paintSign();
@@ -1079,4 +1105,6 @@
 			cbM01Fog.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					if (cbM01Fog.getSelectedIndex() > 0)
 						buoy.setFogSound(cbM01Fog.getSelectedIndex());
@@ -1096,4 +1124,6 @@
 			tfM01FogGroup.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setFogGroup(tfM01FogGroup.getText().trim());
 					buoy.paintSign();
@@ -1110,4 +1140,6 @@
 			tfM01FogPeriod.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setFogPeriod(tfM01FogPeriod.getText().trim());
 					buoy.paintSign();
@@ -1179,4 +1211,6 @@
 			tfM01Height.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setHeight(tfM01Height.getText().trim());
 					buoy.paintSign();
@@ -1193,4 +1227,6 @@
 			tfM01Range.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setRange(tfM01Range.getText().trim());
 					buoy.paintSign();
@@ -1207,4 +1243,6 @@
 			tfM01Group.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setLightGroup(tfM01Group.getText().trim());
 					buoy.paintSign();
@@ -1221,4 +1259,6 @@
 			tfM01RepeatTime.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setLightPeriod(tfM01RepeatTime.getText().trim());
 					buoy.paintSign();
@@ -1228,4 +1268,6 @@
 			tfM01RepeatTime.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setLightPeriod(tfM01RepeatTime.getText().trim());
 					buoy.paintSign();
@@ -1247,4 +1289,6 @@
 			cbM01Colour.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setLightColour((String) cbM01Colour.getSelectedItem());
 					buoy.paintSign();
@@ -1272,4 +1316,6 @@
 			cbM01Sector.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setSectorIndex(cbM01Sector.getSelectedIndex());
 					buoy.paintSign();
@@ -1286,4 +1332,6 @@
 			tfM01Bearing.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setBearing1(tfM01Bearing.getText().trim());
 				}
@@ -1312,4 +1360,6 @@
 			tfM01Radius.addFocusListener(new FocusAdapter() {
 				public void focusLost(FocusEvent e) {
+					if (buoy == null)
+						return;
 					buoy.setRadius(tfM01Radius.getText().trim());
 				}
Index: applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
===================================================================
--- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java	(revision 23294)
+++ applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java	(revision 23295)
@@ -21,4 +21,5 @@
 		super(dia);
 
+System.out.println("new");
 		String str;
 		Map<String, String> keys;
@@ -27,4 +28,6 @@
 
 		resetMask();
+		dlg.cbM01TypeOfMark.setSelectedIndex(CARDINAL);
+
 		dlg.cbM01CatOfMark.removeAllItems();
 		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$
@@ -47,6 +50,4 @@
 		dlg.cbM01StyleOfMark.setVisible(true);
 		dlg.lM01StyleOfMark.setVisible(true);
-
-		dlg.cbM01TypeOfMark.setSelectedIndex(CARDINAL);
 
 		setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
Index: applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
===================================================================
--- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java	(revision 23294)
+++ applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java	(revision 23295)
@@ -26,5 +26,4 @@
 
 		resetMask();
-
 		dlg.cbM01TypeOfMark.setSelectedIndex(ISOLATED_DANGER);
 
Index: applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
===================================================================
--- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java	(revision 23294)
+++ applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java	(revision 23295)
@@ -25,4 +25,5 @@
 
 		resetMask();
+		dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL);
 
 		dlg.cbM01CatOfMark.removeAllItems();
@@ -47,6 +48,4 @@
 		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
 		dlg.cbM01StyleOfMark.setEnabled(true);
-
-		dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL);
 
 		if (keys.containsKey("name")) //$NON-NLS-1$
Index: applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
===================================================================
--- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java	(revision 23294)
+++ applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java	(revision 23295)
@@ -26,5 +26,4 @@
 
 		resetMask();
-
 		dlg.cbM01TypeOfMark.setSelectedIndex(SAFE_WATER);
 
Index: applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
===================================================================
--- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java	(revision 23294)
+++ applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java	(revision 23295)
@@ -26,5 +26,4 @@
 
 		resetMask();
-
 		dlg.cbM01TypeOfMark.setSelectedIndex(SPECIAL_PURPOSE);
 
