Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 12957)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 12958)
@@ -333,8 +333,6 @@
       //trim
       if (TrimOlderGenerations) {
-        for (int i = 0; i < generation - 1; ++i) {
-          var vertices = genealogyGraph.GetByRank(i).ToList();
-          genealogyGraph.RemoveVertices(vertices);
-        }
+        var vertices = genealogyGraph.Vertices.Where(x => x.Rank < generation - 1).ToList(); // select all ranks older than the previous generation
+        genealogyGraph.RemoveVertices(vertices);
       }
 
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs	(revision 12957)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs	(revision 12958)
@@ -121,4 +121,10 @@
       base.RemoveVertex(vertex);
     }
+
+    public override void RemoveVertices(IEnumerable<IVertex> vertices) {
+      foreach (var v in vertices)
+        this.RemoveVertex(v);
+    }
+
     public IGenealogyGraphNode GetByContent(object content) {
       IGenealogyGraphNode result;
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCleanupOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCleanupOperator.cs	(revision 12957)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCleanupOperator.cs	(revision 12958)
@@ -26,5 +26,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tracking {
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [Item("SchemaCleanupOperator", "Operator which removes the schemas from the global scope after they have been evaluated.")]
   [StorableClass]
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs	(revision 12957)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs	(revision 12958)
@@ -33,5 +33,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tracking {
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [Item("SchemaCreator", "An operator that builds schemas based on the heredity relationship in the genealogy graph.")]
   [StorableClass]
@@ -59,8 +59,4 @@
       get { return (IFixedValueParameter<PercentValue>)Parameters[ReplacementRatioParameterName]; }
     }
-
-    private IFixedValueParameter<BoolValue> RandomReplacementParameter {
-      get { return (IFixedValueParameter<BoolValue>)Parameters[RandomReplacementParameterName]; }
-    }
     #endregion
 
@@ -70,4 +66,28 @@
     }
     #endregion
+
+    private SchemaEvaluator schemaEvaluator;
+    private SchemaCleanupOperator schemaCleanupOperator;
+    private DataReducer changedTreesReducer;
+    private DataTableValuesCollector valuesCollector;
+    private ResultsCollector resultsCollector;
+
+    private void ParameterizeOperators() {
+      schemaEvaluator = new SchemaEvaluator();
+      schemaCleanupOperator = new SchemaCleanupOperator();
+
+      changedTreesReducer = new DataReducer();
+      changedTreesReducer.ParameterToReduce.ActualName = schemaEvaluator.ChangedTreesParameter.ActualName;
+      changedTreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+      changedTreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter
+      changedTreesReducer.TargetParameter.ActualName = "NumberOfChangedTrees";
+
+      valuesCollector = new DataTableValuesCollector();
+      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>("NumberOfChangedTrees"));
+      valuesCollector.DataTableParameter.ActualName = "Diversification";
+
+      resultsCollector = new ResultsCollector();
+      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Diversification"));
+    }
 
     public SchemaCreator() {
@@ -77,4 +97,6 @@
       Parameters.Add(new FixedValueParameter<PercentValue>(ReplacementRatioParameterName, new PercentValue(0.2)));
       Parameters.Add(new FixedValueParameter<BoolValue>(RandomReplacementParameterName, new BoolValue(false)));
+
+      ParameterizeOperators();
     }
 
@@ -98,24 +120,12 @@
       var anySubtreeSymbol = new AnySubtreeSymbol();
 
-      var schemaEvaluator = new SchemaEvaluator();
       var scopes = new ScopeList(this.ExecutionContext.Scope.SubScopes);
-      var schemaCleanupOperator = new SchemaCleanupOperator();
-
-      var changedTreesReducer = new DataReducer();
-      changedTreesReducer.ParameterToReduce.ActualName = schemaEvaluator.ChangedTreesParameter.ActualName;
-      changedTreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
-      changedTreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter
-      changedTreesReducer.TargetParameter.ActualName = "NumberOfChangedTrees";
-
-      var valuesCollector = new DataTableValuesCollector();
-      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>("NumberOfChangedTrees"));
-      valuesCollector.DataTableParameter.ActualName = "Diversification";
-
-      var resultCollector = new ResultsCollector();
-      resultCollector.CollectedValues.Add(new LookupParameter<DataTable>("Diversification"));
+
+      if (schemaEvaluator == null || schemaCleanupOperator == null || changedTreesReducer == null || valuesCollector == null || resultsCollector == null)
+        ParameterizeOperators();
 
       var reduceChangedTrees = ExecutionContext.CreateChildOperation(changedTreesReducer);
       var collectValues = ExecutionContext.CreateChildOperation(valuesCollector);
-      var collectResults = ExecutionContext.CreateChildOperation(resultCollector);
+      var collectResults = ExecutionContext.CreateChildOperation(resultsCollector);
 
       var oc = new OperationCollection();
@@ -132,5 +142,5 @@
         var indices = arcs.Select(x => ((IFragment<ISymbolicExpressionTreeNode>)x.Data).Index1).Distinct().ToArray();
         Array.Sort(indices);
-        var nodesToReplace = indices.Where(x => x >= 2).Select(x => nodes[x]).ToList();
+        var nodesToReplace = indices.Select(x => nodes[x]).ToList();
         for (int i = nodesToReplace.Count - 1; i >= 0; --i) {
           var node = nodesToReplace[i];
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs	(revision 12957)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs	(revision 12958)
@@ -31,5 +31,5 @@
 using HeuristicLab.Random;
 
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tracking {
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [Item("SchemaEvaluator", "An operator that builds schemas based on the heredity relationship in the genealogy graph.")]
   [StorableClass]
@@ -95,5 +95,4 @@
       get { return (LookupParameter<IntValue>)Parameters[ChangedTreesParameterName]; }
     }
-
     #endregion
 
@@ -180,8 +179,10 @@
 
       var s = SchemaParameter.ActualValue;
-      var matchingIndividuals = new ScopeList(from ind in individuals
-                                              let t = (ISymbolicExpressionTree)ind.Variables["SymbolicExpressionTree"].Value
-                                              where qm.Match(t, s)
-                                              select ind);
+      var matchingIndividuals = new ScopeList();
+      foreach (var ind in individuals) {
+        var t = (ISymbolicExpressionTree)ind.Variables["SymbolicExpressionTree"].Value;
+        if (t.Length >= s.Length && qm.Match(t, s))
+          matchingIndividuals.Add(ind);
+      }
 
       if (matchingIndividuals.Count < MinimumSchemaFrequency.Value * individuals.Count) {
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateEstimatedValuesOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateEstimatedValuesOperator.cs	(revision 12957)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateEstimatedValuesOperator.cs	(revision 12958)
@@ -29,5 +29,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tracking {
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [Item("UpdateEstimatedValuesOperator", "Put the estimated values of the tree in the scope to be used by the phenotypic similarity calculator")]
   [StorableClass]
@@ -82,7 +82,4 @@
       else
         variables.Add(new Core.Variable("EstimatedValues", new DoubleArray(estimatedValues)));
-      var quality = (DoubleValue)variables["Quality"].Value;
-      if (double.IsNaN(quality.Value))
-        quality.Value = 0.0;
       return base.Apply();
     }
