diff --git a/mosgi.console.component/src/main/java/org/apache/felix/mosgi/console/component/RemoteLogger_jtree.java b/mosgi.console.component/src/main/java/org/apache/felix/mosgi/console/component/RemoteLogger_jtree.java
index 839489b..f18c23f 100644
--- a/mosgi.console.component/src/main/java/org/apache/felix/mosgi/console/component/RemoteLogger_jtree.java
+++ b/mosgi.console.component/src/main/java/org/apache/felix/mosgi/console/component/RemoteLogger_jtree.java
@@ -18,17 +18,35 @@
 
 import org.apache.felix.mosgi.console.ifc.CommonPlugin;
 import org.apache.felix.mosgi.console.ifc.Plugin;
-//import org.apache.felix.mosgi.console.component.JtreeCellRenderer;
 import org.apache.felix.mosgi.console.component.MyTree;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Bundle;
 
-import javax.swing.table.DefaultTableModel;
-import javax.swing.JTable;
+import java.beans.PropertyChangeEvent;
+
 import javax.swing.JButton;
+import javax.swing.JFrame;
 import javax.swing.JPanel;
+import javax.swing.JFileChooser;
+import javax.swing.JPopupMenu;
+import javax.swing.JMenuItem;
 import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+import javax.swing.JOptionPane;
+
 import java.awt.Component;
+import java.awt.BorderLayout;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.ActionEvent;
 
 import javax.management.Notification;
 import javax.management.NotificationListener;
@@ -38,38 +56,17 @@
 
 import java.util.Hashtable;
 import java.util.StringTokenizer;
-
-import java.beans.PropertyChangeEvent;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
 import java.util.Vector;
+import java.util.Date;
+import java.text.DateFormat;
 
 import java.io.PrintStream;
 import java.io.File;
 import java.io.FileNotFoundException;
-import javax.swing.JFileChooser;
 		
-import java.util.Date;
-import java.text.DateFormat;
 //import java.text.SimpleDateFormat;
-
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.JTree;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.JFrame;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreePath;
-import javax.swing.JOptionPane;
 //import org.osgi.service.prefs.Preferences;
 
-import java.awt.event.MouseListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import javax.swing.JPopupMenu;
-import javax.swing.JMenuItem;
-
 public class RemoteLogger_jtree extends DefaultTreeModel implements CommonPlugin, NotificationListener{
 
   private MyTree logTree;
@@ -92,7 +89,7 @@
     JtreeCellRenderer treeCellRenderer=new JtreeCellRenderer(bdlCtx);
     this.logTree.setCellRenderer(treeCellRenderer);
     this.logTree.setLargeModel(true);
-    this.logTree.setToggleClickCount(2); 
+    //this.logTree.setToggleClickCount(2); 
     this.logTree.setRootVisible(false);
     // this create an invisible tree even if I use *expand* so...
     // I use expand after the first insert into the tree
@@ -101,9 +98,9 @@
       public void mousePressed(MouseEvent e) {
         int selRow = logTree.getRowForLocation(e.getX(), e.getY());
         selPath = logTree.getPathForLocation(e.getX(), e.getY());
-        if(selRow != -1 & e.getButton()>1) {
+        if ( selRow!=-1 & e.getButton()>1 ) {
 	  String nodeString="\""+((DefaultMutableTreeNode) selPath.getLastPathComponent()).getUserObject()+"\"";
-	  JMenuItem itemm=new JMenuItem("Delete logs "+nodeString+"");
+	  JMenuItem itemm=new JMenuItem("Delete logs "+nodeString);
 	  itemm.addActionListener(new ActionListener(){
             public void actionPerformed(ActionEvent e){
 	      removeNodeFromParent((DefaultMutableTreeNode) selPath.getLastPathComponent());
@@ -150,16 +147,11 @@
           //System.out.println("RemoteLogger_jtree add a notification listener on this Remote Logger : "+mbs);
 	  ((MBeanServerConnection)e.getNewValue()).addNotificationListener(new ObjectName("OSGI:name=Remote Logger"), this, null, e.getOldValue());
           nodes.put(mbs, "ok");
-          if(JOptionPane.showConfirmDialog(null,"Do you want \""+this.getName()+"\" ask old log to this gateway :\n"+((String) e.getOldValue())+" ?")==JOptionPane.YES_OPTION) {
-            try {
-	      //System.out.println("   => mosgi.console.component.RemoteLoger_jtree gonna ask the oldLog");
-	      mbs.invoke(new ObjectName("OSGI:name=Remote Logger"), "sendOldLog", new Object[]{}, new String[]{});
-	    } catch (Exception ee) {
-	      System.out.println("   => mosgi.console.component.RemoteLoger_jtree : getOldLog : "+ee);
-	    }
+          if (JOptionPane.showConfirmDialog(jp,"Do you want \""+this.getName()+"\" ask old log to this gateway :\n"+((String) e.getOldValue())+" ?")==JOptionPane.YES_OPTION) {
+	    mbs.invoke(new ObjectName("OSGI:name=Remote Logger"), "sendOldLog", new Object[]{}, new String[]{});
 	  }
         }
-      }catch(Exception ex){
+      } catch(Exception ex){
         ex.printStackTrace();
       }
     }
@@ -177,7 +169,7 @@
     }
     if (theNode==null){ // create the node
       theNode=new DefaultMutableTreeNode(nodeToCreateAndGet);
-      // Unable to set tree expand whithout a first node:
+      // Unable to set tree expand whithout a first node so :
       if (rootNode.getChildCount()==0){
         this.insertNodeInto(theNode, parent, 0);
         logTree.expandPath(new TreePath(rootNode.getPath()));
@@ -204,8 +196,7 @@
     String date="??/??/??";
     if (ts==0) {
       isOldLog=true;
-    }
-    if (!isOldLog){
+    } else {
       Date timeDate=new Date(ts);
       //DateFormat dateFormat = new SimpleDateFormat("hh'h'mm dd-MM-yy");
       DateFormat df = DateFormat.getTimeInstance(DateFormat.MEDIUM); // use local date format
@@ -219,17 +210,13 @@
     String state=""+eventName.get(new Integer((int) Integer.parseInt(st.nextToken())));
     String lvl=st.nextToken();
     String msg=st.nextToken();
-    // Get and maybe create parents nodes : ip, ref, idname
+    // Get and maybe create parents nodes : ip / ref / idname
     DefaultMutableTreeNode dmtn_ip=createIfNeed(ip, rootNode, isOldLog);
     DefaultMutableTreeNode dmtn_ref=createIfNeed(ref, dmtn_ip, isOldLog);
     DefaultMutableTreeNode dmtn_idname=createIfNeed(idname, dmtn_ref, isOldLog);
     // insert the leaf with message under id/ref/idname
     DefaultMutableTreeNode dmtn=new DefaultMutableTreeNode(date+" | "+time+" | "+state+" | "+lvl+" | "+msg,false);
-    if (isOldLog){
-      this.insertNodeInto(dmtn, dmtn_idname, dmtn_idname.getChildCount());
-    } else{
-      this.insertNodeInto(dmtn, dmtn_idname, 0);
-    }
+    this.insertNodeInto(dmtn, dmtn_idname, (isOldLog)?dmtn_idname.getChildCount():0);
     this.reload(dmtn_idname);
   }
   
diff --git a/mosgi.console.gui/src/main/java/org/apache/felix/mosgi/console/gui/NodePanel.java b/mosgi.console.gui/src/main/java/org/apache/felix/mosgi/console/gui/NodePanel.java
index e59304f..c583b1d 100644
--- a/mosgi.console.gui/src/main/java/org/apache/felix/mosgi/console/gui/NodePanel.java
+++ b/mosgi.console.gui/src/main/java/org/apache/felix/mosgi/console/gui/NodePanel.java
@@ -18,6 +18,12 @@
 */
 package org.apache.felix.mosgi.console.gui;
 
+import org.apache.felix.mosgi.console.ifc.Plugin;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.io.IOException;
@@ -25,26 +31,21 @@
 import java.rmi.server.RMIClassLoader;
 import java.rmi.server.RMIClassLoaderSpi;
 import java.security.SecureClassLoader;
-import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.Vector;
 import java.util.Set;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ChangeEvent;
 import javax.swing.JTabbedPane;
+import java.lang.IllegalStateException;
 import javax.management.AttributeNotFoundException;
 import javax.management.InstanceNotFoundException;
-//import javax.management.MalformedObjectNameException;
 import javax.management.MBeanException;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
-import org.apache.felix.mosgi.console.ifc.Plugin;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ChangeEvent;
+//import javax.management.MalformedObjectNameException;
 
 public class NodePanel extends JTabbedPane implements PropertyChangeListener, ChangeListener {
   //private String repo;
@@ -73,6 +74,7 @@
   }
 
   public void propertyChange(PropertyChangeEvent event) {
+    //System.out.println("   PCE : "+event.getPropertyName());
     if (event.getPropertyName().equals(Plugin.PLUGIN_ADDED)) {
       Plugin cp=(Plugin) event.getNewValue();
       this.add(cp.getName(), cp.getGUI());
@@ -81,37 +83,33 @@
       this.pluginList.put(cp.pluginLocation(), cp); 
     }else if(event.getPropertyName().equals(Plugin.PLUGIN_REMOVED)) {
       Plugin cp = (Plugin) event.getNewValue();
+      String cpLoc=cp.pluginLocation();
       this.remove(cp.getGUI());
-      this.a.removePropertyChangeListener(cp);
-      //	this.pluginList.remove(cp.pluginLocation());
+      //this.a.removePropertyChangeListener(cp);
+      //this.pluginList.remove(cpLoc);
     }else if(event.getPropertyName().equals(Plugin.EMPTY_NODE)) {
-      System.out.println("******* Debug No node selected");
+      //System.out.println("******* Debug No node selected");
       this.clean();
     }else if (event.getPropertyName().equals(Plugin.NEW_NODE_SELECTED)) {
-      //System.out.println("Event NEW_NODE_SELECTED");
       /* Update the tabs (Plugin) in the JTabbedPane (NodePanel) */
       MBeanServerConnection mbsc = (MBeanServerConnection)event.getNewValue();
       try {
 	this.clean();
         Set ons = mbsc.queryNames( null, null );
-        String msg="";
         for( Iterator i=ons.iterator(); i.hasNext(); ) {
 	  ObjectName name = ( ObjectName )i.next();
-          msg="Queried name: "+name.toString();
           if ( "TabUI".equals(name.getDomain()) ) {
-            msg+=" New tab: "+name.toString();
 	    /* Get the plugin implementation via a bundle */
 	    String tabBundle = (String) mbsc.getAttribute(name, "BundleName");
-            msg+=" Bundle name for current Plugin: "+tabBundle;
 	    if (tabBundle!=null){
               Plugin p = (Plugin) this.pluginList.get(tabBundle);
               if (p == null){
-  	          Bundle b = m_context.installBundle(tabBundle);
-		  b.start();
-                  System.out.println(msg+" Bundle started");
-                  //Thread.sleep(5000);
+  	        Bundle b = m_context.installBundle(tabBundle);
+	        b.start();
+                System.out.println(" - Bundle started: \""+name.toString()+"\" - "+tabBundle);
+                //Thread.sleep(5000);
               }else{
-                System.out.println(msg+" Register service plugin: " + p);
+                System.out.println(" - Register service plugin: "+p);
                 p.registerServicePlugin();
               }
 
@@ -151,8 +149,8 @@
 //            Plugin tab = (Plugin)tabObj;
               /* register the tab on the JTabbedPane */
 //            this.add(tab.getName(), tab.getGUI());
-            }else{
-	      System.out.println(msg+" No "+tabBundle+" property defined. I cannot install "+tabBundle+" tab");
+            } else{
+	      System.out.println(" - No bundleName attribute defined for \""+name.toString()+"\". I cannot install tab");
             }
           }
         }
@@ -184,14 +182,19 @@
 
   private void clean(){
     this.removeAll();
+    Vector pluginList_tmp=new Vector();
     for ( Iterator i=pluginList.keySet().iterator(); i.hasNext();) {
       Object o=i.next();
-      try {
-        ((Plugin) pluginList.get(o)).unregisterServicePlugin();
-      } catch(Exception e){
-        System.out.println("INFO Something went wrong when unregistering the Plugin. Please control the beavior of the unregisterServicePlugin function of this tab"+o);
-      }
+      pluginList_tmp.add(o);
     }
+    for ( int i = 0 ; i < pluginList_tmp.size() ; i++) {
+      Plugin p=(Plugin) pluginList.get(pluginList_tmp.elementAt(i));
+      try {
+        p.unregisterServicePlugin();
+      } catch (Exception ex) {
+	//System.out.println("\""+p.getName()+"\" : "+ex);
+      }
+    } 
   }
 
 }
