Index: trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain.csproj
===================================================================
--- trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain.csproj	(revision 15350)
+++ trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain.csproj	(revision 15494)
@@ -53,4 +53,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
       <Private>False</Private>
     </Reference>
Index: trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.Designer.cs
===================================================================
--- trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.Designer.cs	(revision 15350)
+++ trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.Designer.cs	(revision 15494)
@@ -30,4 +30,8 @@
       this.logView = new HeuristicLab.Core.Views.LogView();
       this.oneFileCheckBox = new System.Windows.Forms.CheckBox();
+      this.label2 = new System.Windows.Forms.Label();
+      this.outputDirectoryTextBox = new System.Windows.Forms.TextBox();
+      this.browseOutputPathButton = new System.Windows.Forms.Button();
+      this.listJobsButton = new System.Windows.Forms.Button();
       this.SuspendLayout();
       // 
@@ -53,7 +57,7 @@
       // 
       this.downloadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.downloadButton.Location = new System.Drawing.Point(698, 38);
+      this.downloadButton.Location = new System.Drawing.Point(753, 82);
       this.downloadButton.Name = "downloadButton";
-      this.downloadButton.Size = new System.Drawing.Size(132, 23);
+      this.downloadButton.Size = new System.Drawing.Size(77, 23);
       this.downloadButton.TabIndex = 3;
       this.downloadButton.Text = "Download";
@@ -68,8 +72,8 @@
       this.logView.Caption = "Log View";
       this.logView.Content = null;
-      this.logView.Location = new System.Drawing.Point(15, 67);
+      this.logView.Location = new System.Drawing.Point(15, 110);
       this.logView.Name = "logView";
       this.logView.ReadOnly = false;
-      this.logView.Size = new System.Drawing.Size(815, 368);
+      this.logView.Size = new System.Drawing.Size(815, 325);
       this.logView.TabIndex = 4;
       // 
@@ -79,5 +83,5 @@
       this.oneFileCheckBox.Checked = true;
       this.oneFileCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
-      this.oneFileCheckBox.Location = new System.Drawing.Point(15, 44);
+      this.oneFileCheckBox.Location = new System.Drawing.Point(15, 88);
       this.oneFileCheckBox.Name = "oneFileCheckBox";
       this.oneFileCheckBox.Size = new System.Drawing.Size(102, 17);
@@ -86,4 +90,44 @@
       this.oneFileCheckBox.UseVisualStyleBackColor = true;
       // 
+      // label2
+      // 
+      this.label2.AutoSize = true;
+      this.label2.Location = new System.Drawing.Point(15, 44);
+      this.label2.Name = "label2";
+      this.label2.Size = new System.Drawing.Size(85, 13);
+      this.label2.TabIndex = 6;
+      this.label2.Text = "Output directory:";
+      // 
+      // outputDirectoryTextBox
+      // 
+      this.outputDirectoryTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.outputDirectoryTextBox.Location = new System.Drawing.Point(152, 38);
+      this.outputDirectoryTextBox.Name = "outputDirectoryTextBox";
+      this.outputDirectoryTextBox.Size = new System.Drawing.Size(595, 20);
+      this.outputDirectoryTextBox.TabIndex = 7;
+      // 
+      // browseOutputPathButton
+      // 
+      this.browseOutputPathButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.browseOutputPathButton.Location = new System.Drawing.Point(753, 37);
+      this.browseOutputPathButton.Name = "browseOutputPathButton";
+      this.browseOutputPathButton.Size = new System.Drawing.Size(75, 22);
+      this.browseOutputPathButton.TabIndex = 8;
+      this.browseOutputPathButton.Text = "Browse";
+      this.browseOutputPathButton.UseVisualStyleBackColor = true;
+      this.browseOutputPathButton.Click += new System.EventHandler(this.browseOutputPathButton_Click);
+      // 
+      // listJobsButton
+      // 
+      this.listJobsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.listJobsButton.Location = new System.Drawing.Point(670, 82);
+      this.listJobsButton.Name = "listJobsButton";
+      this.listJobsButton.Size = new System.Drawing.Size(77, 23);
+      this.listJobsButton.TabIndex = 9;
+      this.listJobsButton.Text = "List Jobs";
+      this.listJobsButton.UseVisualStyleBackColor = true;
+      this.listJobsButton.Click += new System.EventHandler(this.listJobsButton_Click);
+      // 
       // HiveDrainMainWindow
       // 
@@ -91,4 +135,8 @@
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.ClientSize = new System.Drawing.Size(842, 447);
+      this.Controls.Add(this.listJobsButton);
+      this.Controls.Add(this.browseOutputPathButton);
+      this.Controls.Add(this.outputDirectoryTextBox);
+      this.Controls.Add(this.label2);
       this.Controls.Add(this.oneFileCheckBox);
       this.Controls.Add(this.logView);
@@ -112,4 +160,8 @@
     private HeuristicLab.Core.Views.LogView logView;
     private System.Windows.Forms.CheckBox oneFileCheckBox;
+    private System.Windows.Forms.Label label2;
+    private System.Windows.Forms.TextBox outputDirectoryTextBox;
+    private System.Windows.Forms.Button browseOutputPathButton;
+    private System.Windows.Forms.Button listJobsButton;
   }
 }
Index: trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.cs
===================================================================
--- trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.cs	(revision 15350)
+++ trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.cs	(revision 15494)
@@ -32,5 +32,10 @@
       downloadButton.Enabled = false;
 
-      JobDownloader jobDownloader = new JobDownloader(Environment.CurrentDirectory, pattern, Log, oneFileCheckBox.Checked);
+      var directory = outputDirectoryTextBox.Text;
+
+      if (string.IsNullOrEmpty(directory))
+        directory = Environment.CurrentDirectory;
+
+      JobDownloader jobDownloader = new JobDownloader(directory, pattern, Log, oneFileCheckBox.Checked);
       task = new System.Threading.Tasks.Task(jobDownloader.Start);
       task.ContinueWith(x => { Log.LogMessage("All tasks written, quitting."); EnableButton(); }, TaskContinuationOptions.OnlyOnRanToCompletion);
@@ -52,4 +57,23 @@
       }
     }
+
+    private void browseOutputPathButton_Click(object sender, EventArgs e) {
+      var path = string.Empty;
+
+      var dialog = new FolderBrowserDialog {
+        RootFolder = Environment.SpecialFolder.MyComputer
+      };
+
+      if (dialog.ShowDialog() == DialogResult.OK) {
+        path = dialog.SelectedPath;
+      }
+
+      if (!string.IsNullOrEmpty(path))
+        outputDirectoryTextBox.Text = path;
+    }
+
+    private void listJobsButton_Click(object sender, EventArgs e) {
+      ListHiveJobs();
+    }
   }
 }
Index: trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/JobTaskOneFileDownloader.cs
===================================================================
--- trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/JobTaskOneFileDownloader.cs	(revision 15350)
+++ trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/JobTaskOneFileDownloader.cs	(revision 15494)
@@ -29,4 +29,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Optimization;
+using HeuristicLab.Problems.DataAnalysis;
 
 namespace HeuristicLab.HiveDrain {
@@ -70,5 +71,5 @@
 
       var allTasks = HiveServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasksWithoutStateLog(ParentJob.Id));
-      var totalJobCount = allTasks.Count();
+      var totalJobCount = allTasks.Count;
       var optimizers = new List<IOptimizer>();
       var finishedCount = -1;
@@ -114,4 +115,8 @@
       }
       if (storable != null) {
+        // remove duplicate datasets
+        log.LogMessage("Removing duplicate datasets...");
+        DatasetUtil.RemoveDuplicateDatasets(storable);
+
         log.LogMessage(string.Format("Save job as {0}", RootLocation));
         ContentManager.Save(storable, RootLocation, true);
