Index: /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs
===================================================================
--- /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs	(revision 17667)
+++ /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs	(revision 17668)
@@ -219,9 +219,10 @@
             base.Initialize(cancellationToken);
 
-            int pop = ReferencePoint.GetNumberOfGeneratedReferencePoints(NumberOfObjectives);
+            int numberOfGeneratedReferencePoints = ReferencePoint.GetNumberOfGeneratedReferencePoints(NumberOfObjectives);
+            int pop = ((numberOfGeneratedReferencePoints + 3) / 4) * 4;
             PopulationSize.Value = pop;
             InitResults();
+            InitFields();
             InitReferencePoints();
-            InitFields();
             Analyze();
         }
@@ -260,5 +261,5 @@
             Results.Add(new Result(GeneratedReferencePointsResultName, "The initially generated reference points", new DoubleMatrix()));
             Results.Add(new Result(CurrentFrontResultName, "The Pareto Front", new DoubleMatrix()));
-            Results.Add(new Result(CurrentGenerationResultName, "The current generation", new IntValue(0)));
+            Results.Add(new Result(CurrentGenerationResultName, "The current generation", new IntValue(1)));
         }
 
@@ -274,10 +275,17 @@
                 // the next generation) maybe todo: use cloner?
 
-                List<Solution> qt = Mutate(Recombine(solutions));
-                List<Solution> rt = Utility.Concat(solutions, qt);
-
-                solutions = NSGA3Selection.SelectSolutionsForNextGeneration(rt, GetCopyOfReferencePoints(), Problem.Maximization, random);
-
-                ResultsCurrentGeneration.Value++;
+                try
+                {
+                    List<Solution> qt = Mutate(Recombine(solutions));
+                    List<Solution> rt = Utility.Concat(solutions, qt);
+
+                    solutions = NSGA3Selection.SelectSolutionsForNextGeneration(rt, GetCopyOfReferencePoints(), Problem.Maximization, random);
+
+                    ResultsCurrentGeneration.Value++;
+                }
+                catch (Exception ex)
+                {
+                    throw new Exception($"Failed in generation {ResultsCurrentGeneration}", ex);
+                }
             }
         }
Index: /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3Selection.cs
===================================================================
--- /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3Selection.cs	(revision 17667)
+++ /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3Selection.cs	(revision 17668)
@@ -38,4 +38,6 @@
                 lf = i;
             }
+            // remove useless fronts
+            fronts.RemoveRange(lf + 1, fronts.Count - lf - 1);
 
             List<Solution> nextGeneration = new List<Solution>();
@@ -46,5 +48,5 @@
                 // Add every front to the next generation list except for the one that is added only partially
                 nextGeneration = new List<Solution>();
-                for (int f = 0; f < lf - 1; f++)
+                for (int f = 0; f < lf; f++)
                     nextGeneration = Utility.Concat(nextGeneration, fronts[f]);
                 int k = N - nextGeneration.Count;
@@ -109,22 +111,4 @@
                 }
             }
-            // todo: delete this
-            //for (int f = 0; f < Fronts.Count; f++)
-            //{
-            //    foreach (var solution in Fronts[f])
-            //    {
-            //        for (int i = 0; i < NumberOfObjectives; i++)
-            //        {
-            //            if (Math.Abs(intercepts[i] - idealPoint[i]) > EPSILON)
-            //            {
-            //                solution.Fitness[i] = solution.Fitness[i] / (intercepts[i] - idealPoint[i]);
-            //            }
-            //            else
-            //            {
-            //                solution.Fitness[i] = solution.Fitness[i] / EPSILON;
-            //            }
-            //        }
-            //    }
-            //}
         }
 
Index: /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/ReferencePoint.cs
===================================================================
--- /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/ReferencePoint.cs	(revision 17667)
+++ /branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/ReferencePoint.cs	(revision 17668)
@@ -89,6 +89,5 @@
             int outerPoints = Utility.NCR(nDim + outerDiv - 1, outerDiv);
             int innerPoints = innerDiv == 0 ? 0 : Utility.NCR(nDim + innerDiv - 1, innerDiv);
-            int nRefPoints = outerPoints + innerPoints;
-            return nRefPoints;
+            return outerPoints + innerPoints;
         }
 
