Index: branches/histogram/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
===================================================================
--- branches/histogram/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 6011)
+++ branches/histogram/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 6340)
@@ -38,4 +38,5 @@
     private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
     private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
+    private const string ClonedSymbolicExpressionTreeGrammarParameterName = "ClonedSymbolicExpressionTreeGrammar";
     #region Parameter Properties
     public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
@@ -47,4 +48,7 @@
     public IValueLookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionTreeGrammarParameter {
       get { return (IValueLookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionGrammar> ClonedSymbolicExpressionTreeGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[ClonedSymbolicExpressionTreeGrammarParameterName]; }
     }
     #endregion
@@ -57,5 +61,5 @@
     }
     public ISymbolicExpressionGrammar SymbolicExpressionTreeGrammar {
-      get { return SymbolicExpressionTreeGrammarParameter.ActualValue; }
+      get { return ClonedSymbolicExpressionTreeGrammarParameter.ActualValue; }
     }
     #endregion
@@ -69,4 +73,5 @@
       Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
       Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
     }
 
@@ -74,8 +79,24 @@
       return new ProbabilisticTreeCreator(this, cloner);
     }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(ClonedSymbolicExpressionTreeGrammarParameterName))
+        Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+    }
+
+    public override IOperation Apply() {
+      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
+        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
+        IScope globalScope = ExecutionContext.Scope;
+        while (globalScope.Parent != null)
+          globalScope = globalScope.Parent;
+
+        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
+      }
+      return base.Apply();
+    }
 
     protected override ISymbolicExpressionTree Create(IRandom random) {
       return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
-
     }
 
@@ -165,4 +186,5 @@
                                 select s)
                                .ToList();
+          if (allowedSymbols.Count == 0) return false;
           var weights = allowedSymbols.Select(x => x.InitialFrequency).ToList();
           var selectedSymbol = allowedSymbols.SelectRandom(weights, random);
Index: branches/histogram/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs
===================================================================
--- branches/histogram/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 6011)
+++ branches/histogram/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 6340)
@@ -22,5 +22,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -55,5 +54,5 @@
     }
 
-    public sealed override IOperation Apply() {
+    public override IOperation Apply() {
       SymbolicExpressionTree = Create(Random);
       return base.Apply();
