Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs	(revision 5013)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs	(revision 5014)
@@ -66,5 +66,5 @@
       SymbolicExpressionTreeNode crossoverPoint0;
       int replacedSubtreeIndex;
-      SelectCrossoverPoint(random, parent0, internalCrossoverPointProbability, maxTreeSize - 1, maxTreeHeight - 1, out crossoverPoint0, out replacedSubtreeIndex);
+      SelectCrossoverPoint(random, parent0, internalCrossoverPointProbability, maxTreeSize, maxTreeHeight, out crossoverPoint0, out replacedSubtreeIndex);
 
       // calculate the max size and height that the inserted branch can have 
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs	(revision 5013)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs	(revision 5014)
@@ -53,17 +53,13 @@
                                from subtree in parent.SubTrees
                                select new { Parent = parent, Node = subtree, Index = parent.SubTrees.IndexOf(subtree) }).SelectRandom(random);
+
+      int maxSize = maxTreeSize - symbolicExpressionTree.Size + manipulationPoint.Node.GetSize();
+      int maxHeight = maxTreeHeight - symbolicExpressionTree.Height + manipulationPoint.Node.GetHeight();
       // find possible symbols for the node (also considering the existing branches below it)
-      var allowedSymbols = from symbol in manipulationPoint.Parent.GetAllowedSymbols(manipulationPoint.Index)
+      var allowedSymbols = from symbol in manipulationPoint.Parent.GetAllowedSymbols(manipulationPoint.Index, maxHeight)
                            select symbol;
+      if (allowedSymbols.Count() <= 1) return;
 
-      if (allowedSymbols.Count() <= 1) {
-        return;
-      }
-      var oldBranch = manipulationPoint.Node;
-      int oldBranchSize = manipulationPoint.Node.GetSize();
-
-      var seedSymbol = SelectRandomSymbol(random, allowedSymbols);
-
-      // replace the old node with the new node
+      var seedSymbol = SelectRandomSymbol(random, allowedSymbols);  // replace the old node with the new node
       var seedNode = seedSymbol.CreateTreeNode();
       if (seedNode.HasLocalParameters)
@@ -72,6 +68,5 @@
       manipulationPoint.Parent.RemoveSubTree(manipulationPoint.Index);
       manipulationPoint.Parent.InsertSubTree(manipulationPoint.Index, seedNode);
-      int maxSize = Math.Max(oldBranchSize, seedNode.Grammar.GetMinExpressionLength(seedNode.Symbol)) * 2;
-      var bla = ProbabilisticTreeCreator.PTC2(random, seedNode, maxSize, maxSize, 0, 0);
+      seedNode = ProbabilisticTreeCreator.PTC2(random, seedNode, maxSize, maxHeight, 0, 0);
       success = true;
     }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs	(revision 5013)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs	(revision 5014)
@@ -178,4 +178,8 @@
       return Grammar.Symbols.Where(s => Grammar.IsAllowedChild(Symbol, s, argumentIndex));
     }
+    public IEnumerable<Symbol> GetAllowedSymbols(int argumentIndex, int maxExpressionDepth) {
+      return Grammar.Symbols.Where(s => Grammar.IsAllowedChild(Symbol, s, argumentIndex) && Grammar.GetMinExpressionDepth(s) <= maxExpressionDepth);
+    }
+
     public int GetMinSubtreeCount() {
       return Grammar.GetMinSubtreeCount(Symbol);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs	(revision 5013)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs	(revision 5014)
@@ -156,6 +156,6 @@
       : base(original, cloner) {
       operators = original.operators.Select(x => (IOperator)cloner.Clone(x)).ToList();
+      RegisterParameterValueEvents();
       RegisterParameterEvents();
-      RegisterParameterValueEvents();
     }
     public SymbolicRegressionProblemBase()
@@ -171,5 +171,5 @@
       Parameters.Add(new ValueParameter<ISymbolicExpressionGrammar>("FunctionTreeGrammar", "The grammar that should be used for symbolic regression models.", globalGrammar));
       Parameters.Add(new ValueParameter<IntValue>("MaxExpressionLength", "Maximal length of the symbolic expression.", new IntValue(100)));
-      Parameters.Add(new ValueParameter<IntValue>("MaxExpressionDepth", "Maximal depth of the symbolic expression.", new IntValue(10)));
+      Parameters.Add(new ValueParameter<IntValue>("MaxExpressionDepth", "Maximal depth of the symbolic expression. The minimum depth needed for the algorithm is 3 because two levels are reserved for the ProgramRoot and the Start symbol.", new IntValue(10)));
       Parameters.Add(new ValueParameter<IntValue>("MaxFunctionDefiningBranches", "Maximal number of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly()));
       Parameters.Add(new ValueParameter<IntValue>("MaxFunctionArguments", "Maximal number of arguments of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly()));
@@ -182,19 +182,21 @@
       UpdateEstimationLimits();
       InitializeOperators();
+      RegisterParameterValueEvents();
       RegisterParameterEvents();
-      RegisterParameterValueEvents();
-    }
-
-    private void RegisterParameterValueEvents() {
+    }
+
+    private void RegisterParameterEvents() {
       MaxFunctionArgumentsParameter.ValueChanged += new EventHandler(ArchitectureParameter_ValueChanged);
       MaxFunctionDefiningBranchesParameter.ValueChanged += new EventHandler(ArchitectureParameter_ValueChanged);
+      MaxExpressionDepthParameter.ValueChanged += new EventHandler(MaxExpressionDepthParameter_ValueChanged);
       SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
       FunctionTreeGrammarParameter.ValueChanged += new EventHandler(FunctionTreeGrammarParameter_ValueChanged);
-    }
-
-    private void RegisterParameterEvents() {
+      SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);
+    }
+
+    private void RegisterParameterValueEvents() {
       MaxFunctionArgumentsParameter.Value.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
       MaxFunctionDefiningBranchesParameter.Value.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
-      SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);
+      MaxExpressionDepthParameter.Value.ValueChanged += new EventHandler(MaxExpressionDepthParameterValue_ValueChanged);
     }
 
@@ -252,4 +254,13 @@
       OnArchitectureParameterChanged(e);
     }
+
+    private void MaxExpressionDepthParameter_ValueChanged(object sender, EventArgs e) {
+      MaxExpressionDepthParameterValue_ValueChanged(sender, e);
+      MaxExpressionDepthParameter.Value.ValueChanged += MaxExpressionDepthParameterValue_ValueChanged;
+    }
+    private void MaxExpressionDepthParameterValue_ValueChanged(object sender, EventArgs e) {
+      if (MaxExpressionDepth != null && MaxExpressionDepth.Value < 3)
+        MaxExpressionDepth.Value = 3;
+    }
     #endregion
 
@@ -261,6 +272,6 @@
       if (operators == null) InitializeOperators();
       #endregion
+      RegisterParameterValueEvents();
       RegisterParameterEvents();
-      RegisterParameterValueEvents();
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs	(revision 5013)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs	(revision 5014)
@@ -47,4 +47,6 @@
       InitializeComponent();
       matrixView = new StringConvertibleMatrixView();
+      matrixView.ShowRowsAndColumnsTextBox = false;
+      matrixView.ShowStatisticalInformation = false;
       matrixView.Dock = DockStyle.Fill;
       this.Controls.Add(matrixView);
@@ -82,10 +84,17 @@
         DoubleMatrix matrix = null;
         if (Content != null) {
-          double[,] values =
-          MatrixExtensions<double>.Create(
-            Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value),
-            Content.EstimatedValues.ToArray());
+          double[,] values = new double[Content.ProblemData.Dataset.Rows, 4];
+
+          double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value);
+          double[] estimated = Content.EstimatedValues.ToArray();
+          for (int row = 0; row < target.Length; row++) {
+            values[row, 0] = target[row];
+            values[row, 1] = estimated[row];
+            values[row, 2] = estimated[row] - target[row];
+            values[row, 3] = estimated[row] / target[row] - 1;
+          }
+
           matrix = new DoubleMatrix(values);
-          matrix.ColumnNames = new string[] { "Original", "Estimated" };
+          matrix.ColumnNames = new string[] { "Original", "Estimated", "Error", "Rel. Error" };
         }
         matrixView.Content = matrix;
