Index: trunk/sources/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs	(revision 15367)
@@ -312,5 +312,5 @@
       } catch (OperationCanceledException) {
       } catch (AggregateException ae) {
-        OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);
+        ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e));
       } catch (Exception e) {
         OnExceptionOccurred(e);
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 15367)
@@ -222,6 +222,6 @@
     }
 
-    private void startButton_Click(object sender, EventArgs e) {
-      Content.StartAsync();
+    private async void startButton_Click(object sender, EventArgs e) {
+      await Content.StartAsync();
     }
     private void pauseButton_Click(object sender, EventArgs e) {
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs	(revision 15367)
@@ -352,4 +352,6 @@
       allAlgorithmsFinished = new ManualResetEventSlim(false);
 
+      var startedTasks = new List<Task>(clonedAlgorithms.Count);
+
       //start prepared or paused cloned algorithms
       foreach (IAlgorithm clonedAlgorithm in clonedAlgorithms) {
@@ -360,5 +362,6 @@
           lock (locker) {
             if (pausePending || stopPending || ExecutionState != ExecutionState.Started) break;
-            clonedAlgorithm.StartAsync(cancellationToken);
+            var task = clonedAlgorithm.StartAsync(cancellationToken);
+            startedTasks.Add(task);
           }
         }
@@ -366,4 +369,6 @@
 
       allAlgorithmsFinished.Wait();
+
+      Task.WaitAll(startedTasks.ToArray()); // to get exceptions not handled within the tasks
     }
 
Index: trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs
===================================================================
--- trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs	(revision 15367)
@@ -79,7 +79,7 @@
     public override void Prepare() { }
 
-    public override void Start() {
+    public override async void Start() {
       Item.Prepare(initialOperation);
-      Item.StartAsync();
+      await Item.StartAsync();
     }
 
Index: trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs
===================================================================
--- trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs	(revision 15367)
@@ -96,10 +96,10 @@
     }
 
-    public override void Start() {
+    public override async void Start() {
       if ((Item is Experiment && OptimizerAsExperiment.Optimizers.Count == 0) || // experiment would not fire OnStopped if it has 0 optimizers
           (Item is BatchRun && OptimizerAsBatchRun.Optimizer == null)) { // batchrun would not fire OnStopped if algorithm == null
         OnTaskStopped();
       } else {
-        Item.StartAsync();
+        await Item.StartAsync();
       }
     }
Index: trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBAlgorithmView.cs
===================================================================
--- trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBAlgorithmView.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBAlgorithmView.cs	(revision 15367)
@@ -324,6 +324,6 @@
       if (Content != null) Content.StoreAlgorithmInEachRun = storeAlgorithmInEachRunCheckBox.Checked;
     }
-    private void startButton_Click(object sender, EventArgs e) {
-      Content.StartAsync();
+    private async void startButton_Click(object sender, EventArgs e) {
+      await Content.StartAsync();
     }
     private void pauseButton_Click(object sender, EventArgs e) {
Index: trunk/sources/HeuristicLab.Common/3.3/AsyncHelper.cs
===================================================================
--- trunk/sources/HeuristicLab.Common/3.3/AsyncHelper.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Common/3.3/AsyncHelper.cs	(revision 15367)
@@ -21,5 +21,4 @@
 
 using System;
-using System.Linq;
 using System.Runtime.ExceptionServices;
 using System.Threading;
@@ -38,6 +37,5 @@
       } catch (OperationCanceledException) {
       } catch (AggregateException ae) {
-        var e = ae.InnerExceptions.SingleOrDefault() ?? ae;
-        ExceptionDispatchInfo.Capture(e).Throw();
+        ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => ExceptionDispatchInfo.Capture(e).Throw());
       }
     }
Index: trunk/sources/HeuristicLab.Common/3.3/ExceptionExtensions.cs
===================================================================
--- trunk/sources/HeuristicLab.Common/3.3/ExceptionExtensions.cs	(revision 15367)
+++ trunk/sources/HeuristicLab.Common/3.3/ExceptionExtensions.cs	(revision 15367)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Common {
+  public static class ExceptionExtensions {
+    public static void FlattenAndHandle(this AggregateException exception, IEnumerable<Type> exceptionsToHandle, Action<Exception> unhandledCallback) {
+      try {
+        var toHandle = new HashSet<Type>(exceptionsToHandle);
+        exception.Flatten().Handle(x => toHandle.Contains(x.GetType()));
+      } catch (AggregateException remaining) {
+        if (remaining.InnerExceptions.Count == 1) unhandledCallback(remaining.InnerExceptions[0]);
+        else unhandledCallback(remaining);
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj	(revision 15361)
+++ trunk/sources/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj	(revision 15367)
@@ -132,4 +132,5 @@
     <Compile Include="Constants.cs" />
     <Compile Include="ArrayExtensions.cs" />
+    <Compile Include="ExceptionExtensions.cs" />
     <Compile Include="Statistics\EmpiricalCumulativeDistributionFunction.cs" />
     <Compile Include="ListExtensions.cs" />
Index: trunk/sources/HeuristicLab.Core/3.3/Engine.cs
===================================================================
--- trunk/sources/HeuristicLab.Core/3.3/Engine.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Core/3.3/Engine.cs	(revision 15367)
@@ -22,5 +22,4 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Threading;
 using HeuristicLab.Common;
@@ -91,5 +90,5 @@
       } catch (OperationCanceledException) {
       } catch (AggregateException ae) {
-        OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);
+        ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e));
       } catch (Exception e) {
         OnExceptionOccurred(e);
Index: trunk/sources/HeuristicLab.DebugEngine/3.3/DebugEngine.cs
===================================================================
--- trunk/sources/HeuristicLab.DebugEngine/3.3/DebugEngine.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.DebugEngine/3.3/DebugEngine.cs	(revision 15367)
@@ -181,5 +181,5 @@
       } catch (OperationCanceledException) {
       } catch (AggregateException ae) {
-        OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);
+        ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e));
       } catch (Exception e) {
         OnExceptionOccurred(e);
Index: trunk/sources/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs	(revision 15367)
@@ -136,6 +136,6 @@
 
     #region Control events
-    protected virtual void startButton_Click(object sender, EventArgs e) {
-      Content.StartAsync();
+    protected virtual async void startButton_Click(object sender, EventArgs e) {
+      await Content.StartAsync();
     }
     protected virtual void pauseButton_Click(object sender, EventArgs e) {
Index: trunk/sources/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs	(revision 15361)
+++ trunk/sources/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs	(revision 15367)
@@ -84,5 +84,5 @@
       }
       catch (AggregateException ae) {
-        OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);
+        ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e));
       }
       catch (Exception e) {
