Index: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis.Views/3.3/InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs
===================================================================
--- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis.Views/3.3/InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs	(revision 4463)
+++ branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis.Views/3.3/InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs	(revision 4464)
@@ -105,25 +105,18 @@
         horizon = Content.Horizon;
         IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
-        SymbolicExpressionTree tree = (SymbolicExpressionTree)simplifiedExpressionTree.Clone();
-        SymbolicTimeSeriesPrognosisScaledNormalizedMseEvaluator.CalculateScalingParameters(tree,
+        SymbolicTimeSeriesPrognosisScaledNormalizedMseEvaluator.CalculateScalingParameters(simplifiedExpressionTree,
           Content.ProblemData, interpreter,
           conditionVariableName, rows,
           out beta, out alpha);
 
-        quality = SymbolicTimeSeriesPrognosisScaledNormalizedMseEvaluator.Evaluate(tree, Content.ProblemData, interpreter,
+        quality = SymbolicTimeSeriesPrognosisScaledNormalizedMseEvaluator.Evaluate(simplifiedExpressionTree, Content.ProblemData, interpreter,
           conditionVariableName, rows, horizon,
           lowerEstimationLimit, upperEstimationLimit,
           beta, alpha);
 
-        //double originalQuality = SymbolicTimeSeriesPrognosisScaledNormalizedMseEvaluator.Evaluate(
-
-        //  .Calculate(
-        //    Content.Model.Interpreter, new SymbolicExpressionTree(root), Content.LowerEstimationLimit, Content.UpperEstimationLimit,
-        //    Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value,
-        //    Enumerable.Range(samplesStart, samplesEnd - samplesStart));
-
         this.CalculateReplacementNodes();
 
-        this.CalculateNodeImpacts(tree, tree.Root, quality);
+        this.CalculateNodeImpacts(simplifiedExpressionTree, simplifiedExpressionTree.Root, quality);
+        // show only interesing part
         this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0]);
         this.PaintNodeImpacts();
@@ -138,5 +131,5 @@
       SymbolicExpressionTree tree = new SymbolicExpressionTree(root);
       foreach (SymbolicExpressionTreeNode node in this.simplifiedExpressionTree.IterateNodesPrefix()) {
-        if (!(node.Symbol is StartSymbol)) {
+        if (!(node.Symbol is StartSymbol || node.Symbol is ProgramRootSymbol)) {
           while (start.SubTrees.Count > 0) start.RemoveSubTree(0);
           start.AddSubTree(node);
@@ -150,5 +143,5 @@
     private void CalculateNodeImpacts(SymbolicExpressionTree tree, SymbolicExpressionTreeNode currentTreeNode, double originalQuality) {
       foreach (SymbolicExpressionTreeNode childNode in currentTreeNode.SubTrees.ToList()) {
-        if (!(childNode.Symbol is StartSymbol)) {
+        if (!(childNode.Symbol is StartSymbol || childNode.Symbol is ProgramRootSymbol)) {
           SwitchNode(currentTreeNode, childNode, replacementNodes[childNode]);
           int samplesStart = Content.ProblemData.TrainingSamplesStart.Value;
@@ -157,6 +150,5 @@
           double[] beta;
           int horizon = Content.Horizon;
-          IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
-          //SymbolicExpressionTree tree = new SymbolicExpressionTree(root);
+          IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);          
           SymbolicTimeSeriesPrognosisScaledNormalizedMseEvaluator.CalculateScalingParameters(tree,
             Content.ProblemData, interpreter,
@@ -201,14 +193,16 @@
           SymbolicExpressionTreeNode subTree = treeNode.SubTrees[i];
           if (subTree == visualTreeNode.SymbolicExpressionTreeNode) {
-            treeNode.RemoveSubTree(i);
-            if (replacementNodes.ContainsKey(subTree))
+            if (replacementNodes.ContainsKey(subTree)) {
+              treeNode.RemoveSubTree(i);
               treeNode.InsertSubTree(i, replacementNodes[subTree]);
-            else if (subTree is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)subTree))
+            } else if (subTree is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)subTree)) {
+              treeNode.RemoveSubTree(i);
               treeNode.InsertSubTree(i, replacementNodes.Where(v => v.Value == subTree).Single().Key);
-            else if (!(subTree is ConstantTreeNode))
-              throw new InvalidOperationException("Could not find replacement value.");
+            }
+            // if no replacement value is known do nothing
           }
         }
       }
+      // show only interesting part
       this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0]);
 
@@ -249,6 +243,9 @@
         if (treeNode is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)treeNode))
           this.treeChart.GetVisualSymbolicExpressionTreeNode(treeNode).LineColor = Color.DarkOrange;
-        else
-          this.treeChart.GetVisualSymbolicExpressionTreeNode(treeNode).LineColor = Color.Black;
+        else {
+          VisualSymbolicExpressionTreeNode visNode = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
+          if (visNode != null)
+            visNode.LineColor = Color.Black;
+        }
       }
     }
Index: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.cs
===================================================================
--- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 4463)
+++ branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 4464)
@@ -85,7 +85,6 @@
         int samplesStart = Content.ProblemData.TrainingSamplesStart.Value;
         int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value;
-        SymbolicExpressionTree tree = (SymbolicExpressionTree)simplifiedExpressionTree.Clone();
         double originalTrainingMeanSquaredError = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate(
-            Content.Model.Interpreter, tree, Content.LowerEstimationLimit, Content.UpperEstimationLimit,
+            Content.Model.Interpreter, simplifiedExpressionTree, Content.LowerEstimationLimit, Content.UpperEstimationLimit,
             Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value,
             Enumerable.Range(samplesStart, samplesEnd - samplesStart));
@@ -93,5 +92,6 @@
         this.CalculateReplacementNodes();
 
-        this.CalculateNodeImpacts(tree, tree.Root.SubTrees[0], originalTrainingMeanSquaredError);
+        this.CalculateNodeImpacts(simplifiedExpressionTree, simplifiedExpressionTree.Root.SubTrees[0], originalTrainingMeanSquaredError);
+        // show only interesting part of solution
         this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0].SubTrees[0]);
         this.PaintNodeImpacts();
@@ -168,4 +168,6 @@
         }
       }
+
+      // show only interesting part of solution
       this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0].SubTrees[0]);
 
@@ -206,6 +208,9 @@
         if (treeNode is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)treeNode))
           this.treeChart.GetVisualSymbolicExpressionTreeNode(treeNode).LineColor = Color.DarkOrange;
-        else
-          this.treeChart.GetVisualSymbolicExpressionTreeNode(treeNode).LineColor = Color.Black;
+        else {
+          VisualSymbolicExpressionTreeNode visNode = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
+          if (visNode != null)
+            visNode.LineColor = Color.Black;
+        }
       }
     }
