Index: trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs
===================================================================
--- trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs	(revision 2305)
+++ trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs	(revision 2306)
@@ -45,46 +45,23 @@
       if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
       else {
-        base.ShowView(view);
-        DockContent dockForm = new DockForm(view);
-        dockForm.Activated += new EventHandler(DockFormActivated);
-        dockForm.FormClosing += new FormClosingEventHandler(view.FormClosing);
-        dockForm.FormClosed += new FormClosedEventHandler(DockFormClosed);
-        foreach (IToolStripItem item in ToolStripItems)
-          view.StateChanged += new EventHandler(item.ViewChanged);
-        dockForm.Show(dockPanel);
+        if (views.Contains(view)) {
+          DockForm dockform = FindForm(view);
+          if (dockform != null)
+            dockform.Activate();
+        } else {
+          base.ShowView(view);
+          DockContent dockForm = new DockForm(view);
+          dockForm.Activated += new EventHandler(DockFormActivated);
+          dockForm.FormClosing += new FormClosingEventHandler(view.FormClosing);
+          dockForm.FormClosed += new FormClosedEventHandler(DockFormClosed);
+          foreach (IToolStripItem item in ToolStripItems)
+            view.StateChanged += new EventHandler(item.ViewChanged);
+          dockForm.Show(dockPanel);
+        }
       }
     }
 
     public override void CloseView(IView view) {
-      DockForm dockform = null;
-      IEnumerable<DockForm> dockforms;
-
-      if (dockPanel.Documents.Count() != 0) {
-        dockforms = dockPanel.Documents.Cast<DockForm>().Where(df => df.View == view);
-        if (dockforms.Count() == 1)
-          dockform = dockforms.Single();
-      }
-      if (dockPanel.FloatWindows.Count() != 0) {
-        foreach (FloatWindow fw in dockPanel.FloatWindows) {
-          foreach (DockContentCollection dc in fw.NestedPanes.Select(np => np.Contents)) {
-            dockforms = dc.Cast<DockForm>().Where(df => df.View == view);
-            if (dockforms.Count() == 1) {
-              dockform = dockforms.Single();
-              break;
-            }
-          }
-        }
-      }
-      if (dockPanel.DockWindows.Count != 0) {
-        foreach (DockWindow dw in dockPanel.DockWindows) {
-          foreach (DockContentCollection dc in dw.NestedPanes.Select(np => np.Contents)) {
-            dockforms = dc.Cast<DockForm>().Where(df => df.View == view);
-            if (dockforms.Count() == 1) {
-              dockform = dockforms.Single();
-              break;
-            }
-          }
-        }
-      }
+      DockForm dockform = FindForm(view);
       if (dockform != null)
         dockform.Close();
@@ -108,4 +85,33 @@
       base.ActiveView = ((DockForm)sender).View;
     }
+
+    protected DockForm FindForm(IView view) {
+      IEnumerable<DockForm> dockforms;
+
+      if (dockPanel.Documents.Count() != 0) {
+        dockforms = dockPanel.Documents.Cast<DockForm>().Where(df => df.View == view);
+        if (dockforms.Count() == 1)
+          return dockforms.Single();
+      }
+      if (dockPanel.FloatWindows.Count() != 0) {
+        foreach (FloatWindow fw in dockPanel.FloatWindows) {
+          foreach (DockContentCollection dc in fw.NestedPanes.Select(np => np.Contents)) {
+            dockforms = dc.Cast<DockForm>().Where(df => df.View == view);
+            if (dockforms.Count() == 1)
+              return dockforms.Single();
+          }
+        }
+      }
+      if (dockPanel.DockWindows.Count != 0) {
+        foreach (DockWindow dw in dockPanel.DockWindows) {
+          foreach (DockContentCollection dc in dw.NestedPanes.Select(np => np.Contents)) {
+            dockforms = dc.Cast<DockForm>().Where(df => df.View == view);
+            if (dockforms.Count() == 1)
+              return dockforms.Single();
+          }
+        }
+      }
+      return null;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs
===================================================================
--- trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs	(revision 2305)
+++ trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs	(revision 2306)
@@ -114,7 +114,9 @@
 
     public virtual void ShowView(IView view) {
-      view.MainForm = this;
-      views.Add(view);
-      ActiveView = view;
+      if (!views.Contains(view)) {
+        view.MainForm = this;
+        views.Add(view);
+        ActiveView = view;
+      }
     }
 
Index: trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs
===================================================================
--- trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs	(revision 2305)
+++ trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs	(revision 2306)
@@ -51,19 +51,26 @@
       if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
       else {
-        base.ShowView(view);
-        DocumentForm form = new DocumentForm(view);
-        form.Activated += new EventHandler(MultipleDocumentFormActivated);
-        form.FormClosing += new FormClosingEventHandler(view.FormClosing);
-        form.FormClosed += new FormClosedEventHandler(MultipleDocumentFormClosed);
-        form.MdiParent = this;
-        foreach (IToolStripItem item in ToolStripItems)
-          view.StateChanged += new EventHandler(item.ViewChanged);
-        form.Show();
+        if (views.Contains(view)) {
+          DocumentForm documentForm = FindForm(view);
+          if (documentForm != null)
+            documentForm.Focus();
+        } else {
+          base.ShowView(view);
+          DocumentForm form = new DocumentForm(view);
+          form.Activated += new EventHandler(MultipleDocumentFormActivated);
+          form.FormClosing += new FormClosingEventHandler(view.FormClosing);
+          form.FormClosed += new FormClosedEventHandler(MultipleDocumentFormClosed);
+          form.MdiParent = this;
+          foreach (IToolStripItem item in ToolStripItems)
+            view.StateChanged += new EventHandler(item.ViewChanged);
+          form.Show();
+        }
       }
     }
 
     public override void CloseView(IView view) {
-      DocumentForm documentForm = this.MdiChildren.Cast<DocumentForm>().Where(df => df.View == view).Single();
-      documentForm.Close();
+      DocumentForm documentForm = FindForm(view);
+      if (documentForm != null)
+        documentForm.Close();
     }
 
@@ -85,4 +92,11 @@
         form.View.StateChanged -= new EventHandler(item.ViewChanged);
     }
+
+    protected DocumentForm FindForm(IView view) {
+      IEnumerable<DocumentForm> forms = this.MdiChildren.Cast<DocumentForm>().Where(df => df.View == view);
+      if (forms.Count() == 1)
+        return forms.Single();
+      return null;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs
===================================================================
--- trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs	(revision 2305)
+++ trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs	(revision 2306)
@@ -45,19 +45,26 @@
       if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
       else {
-        base.ShowView(view);
-        DocumentForm form = new DocumentForm(view);
-        form.ShowInTaskbar = true;
-        form.Activated += new EventHandler(DockFormActivated);
-        form.FormClosing += new FormClosingEventHandler(view.FormClosing);
-        form.FormClosed += new FormClosedEventHandler(DockFormClosed);
-        foreach (IToolStripItem item in ToolStripItems)
-          view.StateChanged += new EventHandler(item.ViewChanged);
-        form.Show(this);
+        if (views.Contains(view)) {
+          DocumentForm documentForm = FindForm(view);
+          if (documentForm != null)
+            documentForm.Focus();
+        } else {
+          base.ShowView(view);
+          DocumentForm form = new DocumentForm(view);
+          form.ShowInTaskbar = true;
+          form.Activated += new EventHandler(DockFormActivated);
+          form.FormClosing += new FormClosingEventHandler(view.FormClosing);
+          form.FormClosed += new FormClosedEventHandler(DockFormClosed);
+          foreach (IToolStripItem item in ToolStripItems)
+            view.StateChanged += new EventHandler(item.ViewChanged);
+          form.Show(this);
+        }
       }
     }
 
     public override void CloseView(IView view) {
-      DocumentForm documentForm = this.OwnedForms.Cast<DocumentForm>().Where(df => df.View == view).Single();
-      documentForm.Close();
+      DocumentForm documentForm = FindForm(view);
+      if (documentForm != null)
+        documentForm.Close();
     }
 
@@ -79,4 +86,11 @@
       base.ActiveView = ((DocumentForm)sender).View;
     }
+
+    protected DocumentForm FindForm(IView view) {
+      IEnumerable<DocumentForm> forms = this.OwnedForms.Cast<DocumentForm>().Where(df => df.View == view);
+      if (forms.Count() == 1)
+        return forms.Single();
+      return null;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs
===================================================================
--- trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs	(revision 2305)
+++ trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs	(revision 2306)
@@ -57,4 +57,5 @@
       dlo.LoadWith<InputVariableResult>(ir => ir.Result);
       dlo.LoadWith<Model>(m => m.TargetVariable);
+      dlo.LoadWith<Model>(m => m.Algorithm);
       ctx.LoadOptions = dlo;
     }
