Index: /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedComparisonSorter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedComparisonSorter.cs	(revision 4066)
+++ /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedComparisonSorter.cs	(revision 4067)
@@ -58,7 +58,6 @@
       int[] indices = Enumerable.Range(0, size).ToArray();
 
-      Array.Sort(indices, new CustomComparer(ranks, distances));
       IScope[] scopes = ExecutionContext.Scope.SubScopes.ToArray();
-      Array.Sort(indices, scopes);
+      Array.Sort(indices, scopes, new CustomComparer(ranks, distances));
       ExecutionContext.Scope.SubScopes.Clear();
       ExecutionContext.Scope.SubScopes.AddRange(scopes);
Index: /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdingDistanceAssignment.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdingDistanceAssignment.cs	(revision 4066)
+++ /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdingDistanceAssignment.cs	(revision 4067)
@@ -70,5 +70,5 @@
         double minQuality = qualities[0][m];
         double maxQuality = qualities[populationSize - 1][m];
-        for (int i = 2; i < populationSize - 1; i++) {
+        for (int i = 1; i < populationSize - 1; i++) {
           distances[i].Value += (qualities[i + 1][m] - qualities[i - 1][m]) / (maxQuality - minQuality);
         }
@@ -82,8 +82,9 @@
       for (int i = 0; i < populationSize; i++)
         distances[i] = new DoubleValue(0);
+
+      CrowdingDistanceParameter.ActualValue = new ItemArray<DoubleValue>(distances);
       
       Apply(qualities, distances);
 
-      CrowdingDistanceParameter.ActualValue = new ItemArray<DoubleValue>(distances);
       return base.Apply();
     }
Index: /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/FastNonDominatedSort.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/FastNonDominatedSort.cs	(revision 4066)
+++ /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/FastNonDominatedSort.cs	(revision 4067)
@@ -72,5 +72,6 @@
       for (int pI = 0; pI < populationSize - 1; pI++) {
         IScope p = scope.SubScopes[pI];
-        dominatedScopes[p] = new List<int>();
+        if (!dominatedScopes.ContainsKey(p))
+          dominatedScopes[p] = new List<int>();
         for (int qI = pI + 1; qI < populationSize; qI++) {
           DominationResult test = Dominates(qualities[pI], qualities[qI], maximization);
@@ -80,4 +81,6 @@
           } else if (test == DominationResult.IsDominated) {
             dominationCounter[pI] += 1;
+            if (!dominatedScopes.ContainsKey(scope.SubScopes[qI]))
+              dominatedScopes.Add(scope.SubScopes[qI], new List<int>());
             dominatedScopes[scope.SubScopes[qI]].Add(pI);
           }
@@ -98,10 +101,12 @@
         ScopeList nextFront = new ScopeList();
         foreach (IScope p in fronts[i]) {
-          for (int k = 0; k < dominatedScopes[p].Count; k++) {
-            int dominatedScope = dominatedScopes[p][k];
-            dominationCounter[k] -= 1;
-            if (dominationCounter[k] == 0) {
-              rank[k] = new IntValue(i + 1);
-              nextFront.Add(scope.SubScopes[k]);
+          if (dominatedScopes.ContainsKey(p)) {
+            for (int k = 0; k < dominatedScopes[p].Count; k++) {
+              int dominatedScope = dominatedScopes[p][k];
+              dominationCounter[dominatedScope] -= 1;
+              if (dominationCounter[dominatedScope] == 0) {
+                rank[dominatedScope] = new IntValue(i + 1);
+                nextFront.Add(scope.SubScopes[dominatedScope]);
+              }
             }
           }
Index: /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs	(revision 4066)
+++ /trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs	(revision 4067)
@@ -208,4 +208,5 @@
       foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
       ParameterizeSolutionsCreator();
+      ParameterizeRankAndCrowdingSorter();
       ParameterizeMainLoop();
       ParameterizeSelectors();
@@ -226,4 +227,5 @@
       ParameterizeStochasticOperator(Problem.Evaluator);
       ParameterizeSolutionsCreator();
+      ParameterizeRankAndCrowdingSorter();
       ParameterizeMainLoop();
       ParameterizeSelectors();
@@ -251,4 +253,5 @@
     }
     private void Evaluator_QualitiesParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeRankAndCrowdingSorter();
       ParameterizeMainLoop();
       ParameterizeSelectors();
@@ -269,4 +272,8 @@
       SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
       SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+    }
+    private void ParameterizeRankAndCrowdingSorter() {
+      RankAndCrowdingSorter.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+      RankAndCrowdingSorter.QualitiesParameter.ActualName = Problem.Evaluator.QualitiesParameter.ActualName;
     }
     private void ParameterizeMainLoop() {
