Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/WeightedEuclideanDistance.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/WeightedEuclideanDistance.cs	(revision 15550)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/WeightedEuclideanDistance.cs	(revision 15551)
@@ -50,4 +50,5 @@
     [StorableConstructor]
     protected WeightedEuclideanDistance(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
       RegisterParameterEvents();
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs	(revision 15550)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs	(revision 15551)
@@ -230,4 +230,5 @@
         state = cloner.Clone(original.state);
       iter = original.iter;
+      RegisterParameterEvents();
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -322,5 +323,17 @@
     protected override void RegisterProblemEvents() {
       base.RegisterProblemEvents();
+      if (Problem == null) return;
+      Problem.ProblemDataChanged -= OnProblemDataChanged;
       Problem.ProblemDataChanged += OnProblemDataChanged;
+      if (Problem.ProblemData == null) return;
+      Problem.ProblemData.Changed -= OnPerplexityChanged;
+      Problem.ProblemData.Changed -= OnColumnsChanged;
+      Problem.ProblemData.Changed += OnPerplexityChanged;
+      Problem.ProblemData.Changed += OnColumnsChanged;
+      if (Problem.ProblemData.Dataset == null) return;
+      Problem.ProblemData.Dataset.RowsChanged -= OnPerplexityChanged;
+      Problem.ProblemData.Dataset.ColumnsChanged -= OnColumnsChanged;
+      Problem.ProblemData.Dataset.RowsChanged += OnPerplexityChanged;
+      Problem.ProblemData.Dataset.ColumnsChanged += OnColumnsChanged;
     }
 
@@ -341,6 +354,11 @@
       OnPerplexityChanged(this, null);
       OnColumnsChanged(this, null);
+      Problem.ProblemData.Changed -= OnPerplexityChanged;
       Problem.ProblemData.Changed += OnPerplexityChanged;
+      Problem.ProblemData.Changed -= OnColumnsChanged;
       Problem.ProblemData.Changed += OnColumnsChanged;
+      if (Problem.ProblemData.Dataset == null) return;
+      Problem.ProblemData.Dataset.RowsChanged -= OnPerplexityChanged;
+      Problem.ProblemData.Dataset.ColumnsChanged -= OnColumnsChanged;
       Problem.ProblemData.Dataset.RowsChanged += OnPerplexityChanged;
       Problem.ProblemData.Dataset.ColumnsChanged += OnColumnsChanged;
@@ -401,5 +419,5 @@
       var classificationData = problemData as ClassificationProblemData;
       if (classificationData != null && classificationData.TargetVariable.Equals(ClassesName)) {
-        var classNames = classificationData.ClassValues.Zip(classificationData.ClassNames, (v, n) => new { v, n }).ToDictionary(x => x.v, x => x.n);
+        var classNames = classificationData.ClassValues.Zip(classificationData.ClassNames, (v, n) => new {v, n}).ToDictionary(x => x.v, x => x.n);
         var classes = classificationData.Dataset.GetDoubleValues(classificationData.TargetVariable, allIndices).Select(v => classNames[v]).ToArray();
         for (var i = 0; i < classes.Length; i++) {
@@ -420,5 +438,5 @@
         double[][] borders;
         CreateClusters(clusterdata, ClassesName, contours, out clusterModel, out contourMap, out borders);
-        var contourorder = borders.Select((x, i) => new { x, i }).OrderBy(x => x.x[0]).Select(x => x.i).ToArray();
+        var contourorder = borders.Select((x, i) => new {x, i}).OrderBy(x => x.x[0]).Select(x => x.i).ToArray();
         for (var i = 0; i < contours; i++) {
           var c = contourorder[i];
@@ -437,5 +455,5 @@
         double[][] borders;
         CreateClusters(clusterdata, ClassesName, contours, out clusterModel, out contourMap, out borders);
-        var contourorder = borders.Select((x, i) => new { x, i }).OrderBy(x => x.x[0]).Select(x => x.i).ToArray();
+        var contourorder = borders.Select((x, i) => new {x, i}).OrderBy(x => x.x[0]).Select(x => x.i).ToArray();
         for (var i = 0; i < contours; i++) {
           var c = contourorder[i];
