Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs	(revision 16240)
@@ -210,5 +210,5 @@
     protected override void Run(CancellationToken cancellationToken) {
       // Set up the algorithm
-      if (SetSeedRandomly) Seed = new System.Random().Next();
+      if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
       var rand = new MersenneTwister((uint)Seed);
 
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 16240)
@@ -186,5 +186,5 @@
     protected override void Run(CancellationToken cancellationToken) {
       // Set up the algorithm
-      if (SetSeedRandomly) Seed = new System.Random().Next();
+      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
 
       // Set up the results display
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs	(revision 16240)
@@ -130,5 +130,8 @@
           // automatic determination of weights (all features should have variance = 1)
           this.weights = this.allowedInputVariables
-            .Select(name => 1.0 / dataset.GetDoubleValues(name, rows).StandardDeviationPop())
+            .Select(name => {
+              var pop = dataset.GetDoubleValues(name, rows).StandardDeviationPop();
+              return  pop.IsAlmost(0) ? 1.0 : 1.0/pop;
+            })
             .Concat(new double[] { 1.0 }) // no scaling for target variable
             .ToArray();
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs	(revision 16240)
@@ -36,15 +36,6 @@
   public sealed class NeuralNetworkEnsembleModel : ClassificationModel, INeuralNetworkEnsembleModel {
 
+    private object mlpEnsembleLocker = new object();
     private alglib.mlpensemble mlpEnsemble;
-    public alglib.mlpensemble MultiLayerPerceptronEnsemble {
-      get { return mlpEnsemble; }
-      set {
-        if (value != mlpEnsemble) {
-          if (value == null) throw new ArgumentNullException();
-          mlpEnsemble = value;
-          OnChanged(EventArgs.Empty);
-        }
-      }
-    }
 
     public override IEnumerable<string> VariablesUsedForPrediction {
@@ -103,5 +94,5 @@
         }
         // mlpeprocess writes data in mlpEnsemble and is therefore not thread-safe
-        lock (mlpEnsemble) {
+        lock (mlpEnsembleLocker) {
           alglib.mlpeprocess(mlpEnsemble, x, ref y);
         }
@@ -123,5 +114,5 @@
         }
         // mlpeprocess writes data in mlpEnsemble and is therefore not thread-safe
-        lock (mlpEnsemble) {
+        lock (mlpEnsembleLocker) {
           alglib.mlpeprocess(mlpEnsemble, x, ref y);
         }
@@ -145,14 +136,5 @@
       return new NeuralNetworkEnsembleClassificationSolution(this, new ClassificationEnsembleProblemData(problemData));
     }
-
-    #region events
-    public event EventHandler Changed;
-    private void OnChanged(EventArgs e) {
-      var handlers = Changed;
-      if (handlers != null)
-        handlers(this, e);
-    }
-    #endregion
-
+   
     #region persistence
     [Storable]
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs	(revision 16240)
@@ -36,15 +36,6 @@
   public sealed class NeuralNetworkModel : ClassificationModel, INeuralNetworkModel {
 
+    private object mlpLocker = new object();
     private alglib.multilayerperceptron multiLayerPerceptron;
-    public alglib.multilayerperceptron MultiLayerPerceptron {
-      get { return multiLayerPerceptron; }
-      set {
-        if (value != multiLayerPerceptron) {
-          if (value == null) throw new ArgumentNullException();
-          multiLayerPerceptron = value;
-          OnChanged(EventArgs.Empty);
-        }
-      }
-    }
 
     public override IEnumerable<string> VariablesUsedForPrediction {
@@ -107,5 +98,5 @@
         }
         // NOTE: mlpprocess changes data in multiLayerPerceptron and is therefore not thread-save!
-        lock (multiLayerPerceptron) {
+        lock (mlpLocker) {
           alglib.mlpprocess(multiLayerPerceptron, x, ref y);
         }
@@ -127,5 +118,5 @@
         }
         // NOTE: mlpprocess changes data in multiLayerPerceptron and is therefore not thread-save!
-        lock (multiLayerPerceptron) {
+        lock (mlpLocker) {
           alglib.mlpprocess(multiLayerPerceptron, x, ref y);
         }
@@ -150,13 +141,4 @@
     }
 
-    #region events
-    public event EventHandler Changed;
-    private void OnChanged(EventArgs e) {
-      var handlers = Changed;
-      if (handlers != null)
-        handlers(this, e);
-    }
-    #endregion
-
     #region persistence
     [Storable]
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs	(revision 16240)
@@ -186,5 +186,5 @@
         qualityTable.Rows.Add(testRMSERow);
         Results.Add(new Result(qualityTable.Name, qualityTable.Name + " for all restarts", qualityTable));
-        if (SetSeedRandomly) Seed = (new System.Random()).Next();
+        if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
         var rand = new MersenneTwister((uint)Seed);
         bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand);
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs	(revision 16240)
@@ -135,5 +135,5 @@
     protected override void Run(CancellationToken cancellationToken) {
       double rmsError, relClassificationError, outOfBagRmsError, outOfBagRelClassificationError;
-      if (SetSeedRandomly) Seed = new System.Random().Next();
+      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
 
       var model = CreateRandomForestClassificationModel(Problem.ProblemData, NumberOfTrees, R, M, Seed, out rmsError, out relClassificationError, out outOfBagRmsError, out outOfBagRelClassificationError);
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs	(revision 16240)
@@ -134,5 +134,5 @@
     protected override void Run(CancellationToken cancellationToken) {
       double rmsError, avgRelError, outOfBagRmsError, outOfBagAvgRelError;
-      if (SetSeedRandomly) Seed = new System.Random().Next();
+      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
       var model = CreateRandomForestRegressionModel(Problem.ProblemData, NumberOfTrees, R, M, Seed,
         out rmsError, out avgRelError, out outOfBagRmsError, out outOfBagAvgRelError);
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs	(revision 16240)
@@ -275,5 +275,5 @@
       if (wdist != null) wdist.Initialize(problemData);
       if (state == null) {
-        if (SetSeedRandomly) Seed = new System.Random().Next();
+        if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
         var random = new MersenneTwister((uint)Seed);
         var dataset = problemData.Dataset;
