Index: trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs	(revision 4837)
+++ trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs	(revision 4838)
@@ -193,4 +193,8 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
+      // ensure default namespaces and assemblies are present if deserializing old operators
+      namespaces.Add("HeuristicLab.Operators.Programmable");
+      Assemblies[typeof(HeuristicLab.Operators.Operator).Assembly] = true;
+      Assemblies[typeof(HeuristicLab.Operators.Programmable.ProgrammableOperator).Assembly] = true;
       RegisterEvents();
     }
@@ -254,4 +258,5 @@
       typeof(System.Text.StringBuilder).Assembly,
       typeof(System.Data.Linq.DataContext).Assembly,
+      typeof(System.ComponentModel.INotifyPropertyChanged).Assembly,
       typeof(HeuristicLab.Common.IDeepCloneable).Assembly,
       typeof(HeuristicLab.Core.Item).Assembly,
@@ -259,6 +264,6 @@
       typeof(HeuristicLab.Parameters.ValueParameter<IItem>).Assembly,
       typeof(HeuristicLab.Collections.ObservableList<IItem>).Assembly,
-      typeof(System.ComponentModel.INotifyPropertyChanged).Assembly,
-
+      typeof(HeuristicLab.Operators.Operator).Assembly,
+      typeof(HeuristicLab.Operators.Programmable.ProgrammableOperator).Assembly,
     };
 
@@ -293,4 +298,5 @@
         "HeuristicLab.Data",
         "HeuristicLab.Parameters",
+        "HeuristicLab.Operators.Programmable",
         "System",
         "System.Collections.Generic",
@@ -399,5 +405,5 @@
         var sb = new StringBuilder()
         .Append("public static IOperation Execute(")
-        .Append(TypeNameParser.Parse(typeof(IOperator).FullName).GetTypeNameInCode(namespaces))
+        .Append(TypeNameParser.Parse(GetType().FullName).GetTypeNameInCode(namespaces))
         .Append(" op, ")
         .Append(TypeNameParser.Parse(typeof(IExecutionContext).FullName).GetTypeNameInCode(namespaces))
@@ -421,5 +427,5 @@
       method.ReturnType = new CodeTypeReference(typeof(IOperation));
       method.Attributes = MemberAttributes.Public | MemberAttributes.Static;
-      method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IOperator), "op"));
+      method.Parameters.Add(new CodeParameterDeclarationExpression(GetType(), "op"));
       method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IExecutionContext), "context"));
       foreach (var param in Parameters)
@@ -429,8 +435,10 @@
         codeLines[i] = string.Format("#line {0} \"ProgrammableOperator\"{1}{2}", i + 1, "\r\n", codeLines[i]);
       }
-      method.Statements.Add(new CodeSnippetStatement(
-        string.Join("\r\n", codeLines) +
-        "\r\nreturn null;"));
+      method.Statements.Add(new CodeSnippetStatement(string.Join("\r\n", codeLines) + MethodSuffix));
       return method;
+    }
+
+    public virtual string MethodSuffix {
+      get { return "return null;"; }
     }
 
Index: trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.cs	(revision 4837)
+++ trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.cs	(revision 4838)
@@ -71,7 +71,5 @@
       } else {
         codeEditor.Prefix = GetGeneratedPrefix();
-        codeEditor.Suffix = @"    return null;
-  }
-}";
+        codeEditor.Suffix = String.Format("    {0}\n  }}\n}}", ProgrammableOperator.MethodSuffix);
         codeEditor.UserCode = ProgrammableOperator.Code;
         if (codeEditor.UserCode == "")
@@ -121,6 +119,5 @@
         ProgrammableOperator.Compile();
         MessageBox.Show("Compilation successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
-      }
-      catch (Exception ex) {
+      } catch (Exception ex) {
         ErrorHandling.ShowErrorDialog(this, ex);
       }
Index: trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableSingleSuccessorOperator.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableSingleSuccessorOperator.cs	(revision 4837)
+++ trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableSingleSuccessorOperator.cs	(revision 4838)
@@ -9,4 +9,18 @@
   [StorableClass]
   public class ProgrammableSingleSuccessorOperator : ProgrammableOperator {
+
+    public IOperator Successor {
+      get {
+        IParameter parameter;
+        Parameters.TryGetValue("Successor", out parameter);
+        OperatorParameter successorParameter = parameter as OperatorParameter;
+        if (successorParameter == null)
+          return null;
+        return successorParameter.Value;
+      }
+      set {
+        ((OperatorParameter)Parameters["Successor"]).Value = value;
+      }
+    }
 
     [StorableConstructor]
@@ -24,15 +38,6 @@
     }
 
-    public override IOperation Apply() {
-      IOperation operation = base.Apply();
-      if (operation != null)
-        return operation;
-      IParameter parameter;
-      Parameters.TryGetValue("Successor", out parameter);
-      OperatorParameter successorParameter = parameter as OperatorParameter;
-      if (successorParameter != null && successorParameter.Value != null)
-        return ExecutionContext.CreateOperation(successorParameter.Value);
-      else
-        return null;
+    public override string MethodSuffix {
+      get { return "return op.Successor == null ? null : context.CreateOperation(op.Successor);"; }
     }
   }
