Index: trunk/sources/HeuristicLab.Operators/3.3/MultipleCallsOperator.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators/3.3/MultipleCallsOperator.cs	(revision 3210)
+++ trunk/sources/HeuristicLab.Operators/3.3/MultipleCallsOperator.cs	(revision 3211)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using HeuristicLab.Collections;
@@ -34,13 +35,5 @@
   [StorableClass]
   public abstract class MultipleCallsOperator : SingleSuccessorOperator {
-    protected IValueParameter<IOperator>[] OperatorParameters {
-      get {
-        return (from p in Parameters
-                where p is IValueParameter<IOperator>
-                where Operators.Contains(((IValueParameter<IOperator>)p).Value)
-                orderby p.Name ascending
-                select (IValueParameter<IOperator>)p).ToArray();
-      }
-    }
+    private List<OperatorParameter> operatorParameters;
 
     private OperatorList operators;
@@ -49,13 +42,7 @@
       get { return operators; }
       private set {
+        if (operators != null) DeregisterOperatorsEvents();
         operators = value;
-        operators.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsAdded);
-        operators.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsRemoved);
-        operators.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsReplaced);
-        operators.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsMoved);
-        operators.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_CollectionReset);
-        var opParams = OperatorParameters;
-        foreach (IValueParameter<IOperator> opParam in opParams)
-          opParam.ValueChanged += new EventHandler(opParam_ValueChanged);
+        if (operators != null) RegisterOperatorsEvents();
       }
     }
@@ -64,4 +51,15 @@
       : base() {
       Operators = new OperatorList();
+      Initialize();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      operatorParameters = new List<OperatorParameter>();
+      for (int i = 0; i < Operators.Count; i++) {
+        OperatorParameter opParam = (OperatorParameter)Parameters[i.ToString()];
+        operatorParameters.Add(opParam);
+        opParam.ValueChanged += new EventHandler(opParam_ValueChanged);
+      }
     }
 
@@ -69,18 +67,36 @@
       MultipleCallsOperator clone = (MultipleCallsOperator)base.Clone(cloner);
       clone.Operators = (OperatorList)cloner.Clone(operators);
+      clone.Initialize();
       return clone;
     }
 
     private void UpdateOperatorParameters() {
-      var opParams = OperatorParameters;
-      foreach (IValueParameter<IOperator> opParam in opParams) {
+      foreach (OperatorParameter opParam in operatorParameters) {
         opParam.ValueChanged -= new EventHandler(opParam_ValueChanged);
         Parameters.Remove(opParam.Name);
       }
+      operatorParameters.Clear();
       for (int i = 0; i < Operators.Count; i++) {
-        IValueParameter<IOperator> opParam = new OperatorParameter(i.ToString(), string.Empty, Operators[i]);
+        OperatorParameter opParam = new OperatorParameter(i.ToString(), string.Empty, Operators[i]);
         opParam.ValueChanged += new EventHandler(opParam_ValueChanged);
         Parameters.Add(opParam);
+        operatorParameters.Add(opParam);
       }
+    }
+
+    #region Events
+    private void RegisterOperatorsEvents() {
+      operators.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsAdded);
+      operators.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsRemoved);
+      operators.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsReplaced);
+      operators.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsMoved);
+      operators.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_CollectionReset);
+    }
+    private void DeregisterOperatorsEvents() {
+      operators.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsAdded);
+      operators.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsRemoved);
+      operators.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsReplaced);
+      operators.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_ItemsMoved);
+      operators.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<IOperator>>(operators_CollectionReset);
     }
     private void operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOperator>> e) {
@@ -92,9 +108,9 @@
     private void operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOperator>> e) {
       foreach (IndexedItem<IOperator> item in e.Items)
-        ((IValueParameter<IOperator>)Parameters[item.Index.ToString()]).Value = item.Value;
+        operatorParameters[item.Index].Value = item.Value;
     }
     private void operators_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOperator>> e) {
       foreach (IndexedItem<IOperator> item in e.Items)
-        ((IValueParameter<IOperator>)Parameters[item.Index.ToString()]).Value = item.Value;
+        operatorParameters[item.Index].Value = item.Value;
     }
     private void operators_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOperator>> e) {
@@ -102,8 +118,8 @@
     }
     private void opParam_ValueChanged(object sender, EventArgs e) {
-      IValueParameter<IOperator> opParam = (IValueParameter<IOperator>)sender;
-      int index = int.Parse(opParam.Name);
-      operators[index] = opParam.Value;
+      OperatorParameter opParam = (OperatorParameter)sender;
+      operators[operatorParameters.IndexOf(opParam)] = opParam.Value;
     }
+    #endregion
   }
 }
