Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 1331)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 1332)
@@ -475,14 +475,5 @@
         String s = get(key);
         if(s != null && s.length() != 0)
-        {
-            /* handle old comma separated stuff - remove in future */
-            if(s.indexOf(',') >= 0)
-                return Arrays.asList(s.split(","));
-            /* handle space separated stuff - remove in future */
-            else if(s.indexOf(' ') >= 0)
-                return Arrays.asList(s.split(" "));
-            else
-                return Arrays.asList(s.split(";"));
-        }
+           return Arrays.asList(s.split(";"));
         return def;
     }
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 1331)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 1332)
@@ -6,4 +6,5 @@
 import java.awt.Component;
 import java.awt.Container;
+import java.util.ArrayList;
 
 import javax.swing.AbstractButton;
@@ -70,4 +71,5 @@
      */
     public JPanel toggleDialogs = new JPanel();
+    public ArrayList<ToggleDialog> allDialogs = new ArrayList<ToggleDialog>();
 
     public final ButtonGroup toolGroup = new ButtonGroup();
@@ -116,4 +118,6 @@
      */
     public void destroy() {
+        for (ToggleDialog t : allDialogs)
+            t.close();
         for (int i = 0; i < toolBarActions.getComponentCount(); ++i)
             if (toolBarActions.getComponent(i) instanceof Destroyable)
@@ -154,4 +158,5 @@
         toolBarToggle.add(button);
         toggleDialogs.add(dlg);
+        allDialogs.add(dlg);
         return button;
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 1331)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 1332)
@@ -60,4 +60,11 @@
             if(!selected && winadapter != null)
                 winadapter.windowClosing(null);
+            else if (!Main.pref.getBoolean(action.prefname+".docked", true)) {
+                EventQueue.invokeLater(new Runnable(){
+                    public void run() {
+                        stickyActionListener.actionPerformed(null);
+                    }
+                });
+            }
         }
     }
@@ -71,4 +78,5 @@
     public JPanel parent;
     WindowAdapter winadapter;
+    private ActionListener stickyActionListener;
     private final JPanel titleBar = new JPanel(new GridBagLayout());
     public JLabel label = new JLabel();
@@ -151,5 +159,5 @@
         sticky.setToolTipText(tr("Undock the panel"));
         sticky.setBorder(BorderFactory.createEmptyBorder());
-        final ActionListener stickyActionListener = new ActionListener(){
+        stickyActionListener = new ActionListener(){
             public void actionPerformed(ActionEvent e) {
                 final JFrame f = new JFrame(name);
@@ -169,5 +177,6 @@
                             setVisible(true);
                         titleBar.setVisible(true);
-                        Main.pref.put(action.prefname+".docked", true);
+                        if(e != null)
+                            Main.pref.put(action.prefname+".docked", true);
                     }
                 }));
@@ -230,4 +239,10 @@
     }
 
+    public void close()
+    {
+        if(winadapter != null)
+            winadapter.windowClosing(null);
+    }
+
     public void setTitle(String title, boolean active) {
         if(active) {
