Index: trunk/sources/HeuristicLab.CEDMA.Core/AgentList.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Core/AgentList.cs	(revision 419)
+++ trunk/sources/HeuristicLab.CEDMA.Core/AgentList.cs	(revision 420)
@@ -30,4 +30,5 @@
 using System.Runtime.Serialization;
 using System.IO;
+using HeuristicLab.Operators;
 
 namespace HeuristicLab.CEDMA.Core {
@@ -50,5 +51,10 @@
         newAgent.Status = a.Status;
         IOperatorGraph opGraph = (IOperatorGraph)PersistenceManager.RestoreFromGZip(a.RawData);
-        foreach(IOperator op in opGraph.Operators) newAgent.OperatorGraph.AddOperator(op);
+
+        DownloadOperators(opGraph, new Dictionary<long, IOperator>());
+
+        foreach(IOperator op in opGraph.Operators) {
+          newAgent.OperatorGraph.AddOperator(op);
+        }
         newAgent.OperatorGraph.InitialOperator = opGraph.InitialOperator;
         agentList.Add(newAgent);
@@ -80,4 +86,27 @@
     }
 
+    private void DownloadOperators(IOperatorGraph opGraph, Dictionary<long, IOperator> downloaded) {
+      foreach(IOperator op in opGraph.Operators) {
+        DownloadOperators(op, downloaded);
+      }
+    }
+
+    private void DownloadOperators(IOperator op, Dictionary<long, IOperator> downloaded) {
+      if(op is OperatorLink) {
+        OperatorLink link = op as OperatorLink;
+        if(downloaded.ContainsKey(link.Id)) {
+          link.Operator = downloaded[link.Id];
+        } else {
+          OperatorEntry targetEntry = database.GetOperator(link.Id);
+          IOperator target = (IOperator)PersistenceManager.RestoreFromGZip(targetEntry.RawData);
+          downloaded.Add(link.Id, target);
+          DownloadOperators(target, downloaded);
+          link.Operator = target;
+        }
+      } else if(op is CombinedOperator) {
+        DownloadOperators(((CombinedOperator)op).OperatorGraph, downloaded);
+      }
+    }
+
     public override IView CreateView() {
       return new AgentListView(this);
Index: trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/IDatabase.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/IDatabase.cs	(revision 419)
+++ trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/IDatabase.cs	(revision 420)
@@ -73,4 +73,7 @@
     ICollection<OperatorEntry> GetOperators();
 
+    [OperationContract]
+    OperatorEntry GetOperator(long agentId);
+
   }
 }
Index: trunk/sources/HeuristicLab.CEDMA.Server/RunScheduler.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Server/RunScheduler.cs	(revision 419)
+++ trunk/sources/HeuristicLab.CEDMA.Server/RunScheduler.cs	(revision 420)
@@ -76,7 +76,5 @@
         IOperatorGraph opGraph = (IOperatorGraph)PersistenceManager.RestoreFromGZip(entry.RawData);
 
-        foreach(IOperator op in opGraph.Operators) {
-          PatchLinks(op);
-        }
+        PatchLinks(opGraph, new Dictionary<long, IOperator>());
 
         AtomicOperation operation = new AtomicOperation(opGraph.InitialOperator, scope);
@@ -99,20 +97,42 @@
     }
 
-    private void PatchLinks(IOperator op) {
-      if(op is OperatorLink) {
-        OperatorLink link = op as OperatorLink;
-        OperatorEntry targetEntry = database.GetOperator(link.Id);
-        IOperator target = (IOperator)PersistenceManager.RestoreFromGZip(targetEntry.RawData);
-        ReplaceOperatorInGraph(link, target);
-      } else if(op is CombinedOperator) {
-        CombinedOperator combinedOp = op as CombinedOperator;
-        foreach(IOperator internalOp in combinedOp.OperatorGraph.Operators) {
-          PatchLinks(internalOp);
+    private void PatchLinks(IOperatorGraph opGraph, Dictionary<long, IOperator> patchedOperators) {
+      Dictionary<IOperator, IOperator> patchDictionary = new Dictionary<IOperator, IOperator>();
+      foreach(IOperator op in opGraph.Operators) {
+        IOperator patched = PatchLinks(op, patchedOperators);
+        patchDictionary.Add(op, patched);
+      }
+      foreach(KeyValuePair<IOperator, IOperator> p in patchDictionary) {
+        IOperator original = p.Key;
+        IOperator patch = p.Value;
+        if(original != patch) {
+          foreach(IOperator subOperator in original.SubOperators) {
+            patch.AddSubOperator(subOperator);
+          }
+          if(opGraph.InitialOperator == original)
+            opGraph.InitialOperator = patch;
+          opGraph.RemoveOperator(original.Guid);
+          opGraph.AddOperator(patch);
         }
       }
     }
 
-    private void ReplaceOperatorInGraph(OperatorLink link, IOperator target) {
-      throw new NotImplementedException();
+    private IOperator PatchLinks(IOperator op, Dictionary<long, IOperator> patchedOperators) {
+      if(op is OperatorLink) {
+        OperatorLink link = op as OperatorLink;
+        if(patchedOperators.ContainsKey(link.Id)) {
+          return patchedOperators[link.Id];
+        } else {
+          OperatorEntry targetEntry = database.GetOperator(link.Id);
+          IOperator target = (IOperator)PersistenceManager.RestoreFromGZip(targetEntry.RawData);
+          patchedOperators.Add(link.Id, target);
+          PatchLinks(target, patchedOperators);
+          return target;
+        }
+      } else if(op is CombinedOperator) {
+        PatchLinks(((CombinedOperator)op).OperatorGraph, patchedOperators);
+        return op;
+      }
+      return op;
     }
 
