Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 23593)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 24125)
@@ -1,7 +1,3 @@
 package org.openstreetmap.josm.plugins.turnrestrictions;
-
-import static org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder.determineWayJoinOrientation;
-import static org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder.isEndNode;
-import static org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder.isStartNode;
 
 import java.util.ArrayList;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 23593)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 24125)
@@ -87,6 +87,4 @@
     private JosmSelectionPanel pnlJosmSelection;
     private BasicEditorPanel pnlBasicEditor;
-    private AdvancedEditorPanel pnlAdvancedEditor;
-    private IssuesView pnlIssuesView;
     private TurnRestrictionEditorModel editorModel;
     private JTabbedPane tpEditors;
@@ -102,8 +100,11 @@
         pnl.setLayout(new FlowLayout(FlowLayout.CENTER));
 
-        pnl.add(new SideButton(new OKAction()));
-        pnl.add(new SideButton(new CancelAction()));
-        
-        pnl.add(new SideButton(new ContextSensitiveHelpAction(ht("/Plugins/turnrestrictions#TurnRestrictionEditor"))));
+        SideButton b;
+        pnl.add(b = new SideButton(new OKAction()));
+        b.setName("btnOK");
+        pnl.add(b = new SideButton(new CancelAction()));
+        b.setName("btnCancel");
+        pnl.add(b = new SideButton(new ContextSensitiveHelpAction(ht("/Plugins/turnrestrictions#TurnRestrictionEditor"))));
+        b.setName("btnHelp");
         return pnl;
     }
@@ -134,9 +135,9 @@
         tpEditors.setToolTipTextAt(0, tr("Edit basic attributes of a turn restriction"));
         
-        tpEditors.add(pnlAdvancedEditor = new AdvancedEditorPanel(editorModel));
+        tpEditors.add(new AdvancedEditorPanel(editorModel));
         tpEditors.setTitleAt(1, tr("Advanced"));
         tpEditors.setToolTipTextAt(1, tr("Edit the raw tags and members of this turn restriction"));
         
-        tpEditors.add(pnlIssuesView = new IssuesView(editorModel.getIssuesModel()));
+        tpEditors.add(new IssuesView(editorModel.getIssuesModel()));
         tpEditors.setTitleAt(2, tr("Errors/Warnings"));
         tpEditors.setToolTipTextAt(2, tr("Show errors and warnings related to this turn restriction"));
@@ -650,5 +651,5 @@
                 return;
             }
-            if (getTurnRestriction() == null) {
+            if (getTurnRestriction() == null || getTurnRestriction().getDataSet() == null) {
                 applyNewTurnRestriction();
                 return;
@@ -693,5 +694,5 @@
                 return;
             }
-            if (getTurnRestriction() == null) {
+            if (getTurnRestriction() == null || getTurnRestriction().getDataSet() == null) {
                 // it's a new turn restriction. Try to save it and close the dialog
                 if (applyNewTurnRestriction()) {
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 23593)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 24125)
@@ -220,5 +220,4 @@
         CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");      
         TagCollection tags = tagEditorModel.getTagCollection();
-        logger.info(tags.toString());
         turnRestriction.removeAll();
         tags.applyTo(turnRestriction);
