Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs	(revision 6479)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs	(revision 6492)
@@ -116,5 +116,5 @@
         TreeNode stn = new TreeNode(r.Name);
         if (r is Slave) {
-          stn.ImageIndex = 0;
+          stn.ImageIndex = slaveImageIndex;
         } else if (r is SlaveGroup) {
           stn.ImageIndex = slaveGroupImageIndex;
@@ -125,4 +125,5 @@
 
         BuildSlaveGroupTree(r, stn);
+        tn.ExpandAll();
       }
     }
@@ -169,18 +170,20 @@
 
     private void btnRemoveGroup_Click(object sender, EventArgs e) {
-      //TODO: display some warning?
       if (treeSlaveGroup.SelectedNode != null && treeSlaveGroup.SelectedNode.Tag != null) {
         Resource res = (Resource)treeSlaveGroup.SelectedNode.Tag;
 
-        if (res is Slave) {
-          Content.Remove(res);
-          ServiceLocator.Instance.CallHiveService(service => service.DeleteSlave(res.Id));
-        } else if (res is SlaveGroup) {
-          //only delete empty groups
-          if (Content.Where(s => s.ParentResourceId == res.Id).Count() < 1) {
+        DialogResult diagRes = MessageBox.Show("Do you really want to delete " + res.Name + "?", "HeuristicLab Hive Administration", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+        if (diagRes == DialogResult.Yes) {
+          if (res is Slave) {
             Content.Remove(res);
-            ServiceLocator.Instance.CallHiveService(service => service.DeleteSlaveGroup(res.Id));
-          } else {
-            MessageBox.Show("Only empty groups can be deleted.", "HeuristicLab Hive Administration", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            ServiceLocator.Instance.CallHiveService(service => service.DeleteSlave(res.Id));
+          } else if (res is SlaveGroup) {
+            //only delete empty groups
+            if (Content.Where(s => s.ParentResourceId == res.Id).Count() < 1) {
+              Content.Remove(res);
+              ServiceLocator.Instance.CallHiveService(service => service.DeleteSlaveGroup(res.Id));
+            } else {
+              MessageBox.Show("Only empty groups can be deleted.", "HeuristicLab Hive Administration", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
           }
         }
@@ -218,8 +221,15 @@
 
           SlaveGroup sgrp = null;
+          TreeNode parentNode = null;
           if (destNode.Tag != null && destNode.Tag is SlaveGroup) {
             sgrp = (SlaveGroup)destNode.Tag;
+            parentNode = destNode;
           } else if (destNode.Parent != null && destNode.Parent.Tag is SlaveGroup) {
             sgrp = (SlaveGroup)destNode.Parent.Tag;
+            parentNode = destNode.Parent;
+          }
+
+          if (newNode.Tag is SlaveGroup && CheckParentsEqualsMovedNode(parentNode, newNode)) {
+            return;
           }
 
@@ -234,4 +244,7 @@
               if (slave.ParentResourceId == null || (slave.ParentResourceId != null && slave.ParentResourceId != sgrp.Id)) {
                 slave.ParentResourceId = sgrp.Id;
+                newNode.Remove();
+                parentNode.Nodes.Clear();
+                BuildSlaveGroupTree(sgrp, parentNode);
               }
             } else if (newNode.Tag is SlaveGroup) {
@@ -239,10 +252,24 @@
               if (slaveGroup.ParentResourceId == null || (slaveGroup.ParentResourceId != null && slaveGroup.ParentResourceId != sgrp.Id)) {
                 slaveGroup.ParentResourceId = sgrp.Id;
+                newNode.Remove();
+                parentNode.Nodes.Clear();
+                BuildSlaveGroupTree(sgrp, parentNode);
               }
             }
-            OnContentChanged();
-          }
-        }
-      }
+          }
+        }
+      }
+    }
+
+    private bool CheckParentsEqualsMovedNode(TreeNode dest, TreeNode movedNode) {
+      TreeNode tmp = dest;
+
+      while (tmp != null) {
+        if (tmp == movedNode) {
+          return true;
+        }
+        tmp = tmp.Parent;
+      }
+      return false;
     }
 
