Index: branches/ProblemRefactoring/HeuristicLab.Core.Views/3.3/TypeSelector.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.Core.Views/3.3/TypeSelector.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.Core.Views/3.3/TypeSelector.cs	(revision 13422)
@@ -257,4 +257,5 @@
     }
 
+    private Type[] genericTypeArguments = null;
     protected virtual void UpdateTypeParameters() {
       typeParametersListView.Items.Clear();
@@ -262,4 +263,5 @@
         typeParametersGroupBox.Enabled = false;
         typeParametersSplitContainer.Panel2Collapsed = true;
+        genericTypeArguments = null;
       } else {
         typeParametersGroupBox.Enabled = true;
@@ -267,5 +269,8 @@
         setTypeParameterButton.Enabled = false;
 
-        foreach (Type param in SelectedType.GetGenericArguments()) {
+
+        genericTypeArguments = SelectedType.GetGenericArguments();
+
+        foreach (Type param in genericTypeArguments) {
           if (param.IsGenericParameter) {
             ListViewItem item = new ListViewItem();
@@ -301,7 +306,7 @@
       if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
         Type selected = typeSelectorDialog.TypeSelector.SelectedType;
-        Type[] parameters = SelectedType.GetGenericArguments();
-        parameters[param.GenericParameterPosition] = selected;
-        SelectedType = SelectedType.GetGenericTypeDefinition().MakeGenericType(parameters);
+        genericTypeArguments[param.GenericParameterPosition] = selected;
+        if (genericTypeArguments.All(p => !p.IsGenericParameter))
+          SelectedType = SelectedType.GetGenericTypeDefinition().MakeGenericType(genericTypeArguments);
 
         typeParametersListView.SelectedItems[0].Text = param.Name + ": " + selected.GetPrettyName();
Index: branches/ProblemRefactoring/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.cs	(revision 13422)
@@ -58,5 +58,6 @@
     }
     protected virtual void typeSelector_SelectedTypeChanged(object sender, EventArgs e) {
-      okButton.Enabled = typeSelector.SelectedType != null;
+      var selectedType = typeSelector.SelectedType;
+      okButton.Enabled = selectedType != null && !selectedType.IsGenericTypeDefinition;
     }
     protected virtual void TypesTreeView_DoubleClick(object sender, System.EventArgs e) {
Index: branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs	(revision 13422)
@@ -131,5 +131,5 @@
                             let t = assemblyType.BuildType(type)
                             where t != null
-                            where t.IsSubTypeOf(type)
+                            where t.IsAssignableTo(type)
                             where !t.IsNonDiscoverableType()
                             where onlyInstantiable == false || (!t.IsAbstract && !t.IsInterface && !t.HasElementType)
Index: branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs	(revision 13422)
@@ -264,5 +264,5 @@
                           let t = assemblyType.BuildType(type)
                           where t != null
-                          where t.IsSubTypeOf(type)
+                          where t.IsAssignableTo(type)
                           where !t.IsNonDiscoverableType()
                           where onlyInstantiable == false || (!t.IsAbstract && !t.IsInterface && !t.HasElementType)
Index: branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/TypeExtensions.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/TypeExtensions.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.PluginInfrastructure/3.3/TypeExtensions.cs	(revision 13422)
@@ -76,21 +76,19 @@
     }
 
-    internal static bool IsSubTypeOf(this Type subType, Type baseType) {
+    internal static bool IsAssignableTo(this Type subType, Type baseType) {
       if (baseType.IsAssignableFrom(subType)) return true;
+
+      //check generics
       if (!baseType.IsGenericType) return false;
+      if (RecursiveCheckGenericTypes(baseType, subType)) return true;
 
-      if (RecursiveCheckGenericTypes(baseType, subType)) return true;
+      //check generic interfaces
       IEnumerable<Type> implementedInterfaces = subType.GetInterfaces().Where(t => t.IsGenericType);
-      foreach (var implementedInterface in implementedInterfaces.Where(i => i.IsGenericType)) {
-        if (baseType.CheckGenericTypes(implementedInterface)) return true;
-      }
-
-      return false;
+      return implementedInterfaces.Any(implementedInterface => baseType.CheckGenericTypes(implementedInterface));
     }
 
     private static bool RecursiveCheckGenericTypes(Type baseType, Type subType) {
       if (!baseType.IsGenericType) return false;
-      if (!subType.IsGenericType) return false;
-      if (baseType.CheckGenericTypes(subType)) return true;
+      if (subType.IsGenericType && baseType.CheckGenericTypes(subType)) return true;
       if (subType.BaseType == null) return false;
 
@@ -102,4 +100,5 @@
       var subTypeGenericTypeDefinition = subType.GetGenericTypeDefinition();
       if (baseTypeGenericTypeDefinition != subTypeGenericTypeDefinition) return false;
+
       var baseTypeGenericArguments = baseType.GetGenericArguments();
       var subTypeGenericArguments = subType.GetGenericArguments();
@@ -109,17 +108,48 @@
         var subTypeGenericArgument = subTypeGenericArguments[i];
 
-        if (baseTypeGenericArgument.IsGenericParameter ^ subTypeGenericArgument.IsGenericParameter) return false;
-        if (baseTypeGenericArgument == subTypeGenericArgument) continue;
-        if (!baseTypeGenericArgument.IsGenericParameter && !subTypeGenericArgument.IsGenericParameter) return false;
+        //no generic parameters => concrete types => check for type equality (ignore co- and contravariance)
+        //for example List<int> is only a List<int>, IParameter<IItem> is not a base type of IParameter<DoubleValue>
+        if (!baseTypeGenericArgument.IsGenericParameter && !subTypeGenericArgument.IsGenericParameter) {
+          if (baseTypeGenericArgument == subTypeGenericArgument) continue;
+          return false;
+        }
 
-        if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.ReferenceTypeConstraint) &&
-            !subTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.ReferenceTypeConstraint)) return false;
-        if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint) &&
-            !subTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint)) return false;
-        if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.NotNullableValueTypeConstraint) &&
-            !subTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.NotNullableValueTypeConstraint)) return false;
+        //baseTypeGenericArgument is a concrete type and the subTypeGenericArgument is a generic parameter
+        //for example List<int> is not a base type of List<T>
+        if (!baseTypeGenericArgument.IsGenericParameter && subTypeGenericArgument.IsGenericParameter) return false;
 
-        foreach (var baseTypeGenericParameterConstraint in baseTypeGenericArgument.GetGenericParameterConstraints()) {
-          if (!subTypeGenericArgument.GetGenericParameterConstraints().Any(t => baseTypeGenericParameterConstraint.IsAssignableFrom(t))) return false;
+        //baseTypeGenericArugment is a generic parameter and the subTypeGenericArgument is a concrete type => check type constraints
+        //for example IParameter<T> is a base type of IParameter<IItem> if all generic contraints on T are fulfilled
+        if (baseTypeGenericArgument.IsGenericParameter && !subTypeGenericArgument.IsGenericParameter) {
+          if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.ReferenceTypeConstraint) &&
+            subTypeGenericArgument.IsValueType) return false;
+          if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint) &&
+            subTypeGenericArgument.GetConstructor(Type.EmptyTypes) == null) return false;
+          if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.NotNullableValueTypeConstraint)) {
+            if (!subTypeGenericArgument.IsValueType) return false;
+            if (subTypeGenericArgument.IsGenericType && subTypeGenericArgument.GetGenericTypeDefinition() == typeof(Nullable<>))
+              return false;
+          }
+
+          //not assignable if the subTypeGenericArgument is not assignable to all of the constraints of the base type
+          if (baseTypeGenericArgument.GetGenericParameterConstraints().Any(baseTypeGenericParameterConstraint =>
+            !baseTypeGenericParameterConstraint.IsAssignableFrom(subTypeGenericArgument)))
+            return false;
+        }
+
+        //both generic arguments are generic parameters => check type constraints
+        //for example IParameter<T> is a base type of IParameter<T>
+        if (baseTypeGenericArgument.IsGenericParameter && subTypeGenericArgument.IsGenericParameter) {
+          if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.ReferenceTypeConstraint) &&
+              !subTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.ReferenceTypeConstraint)) return false;
+          if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint) &&
+              !subTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint)) return false;
+          if (baseTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.NotNullableValueTypeConstraint) &&
+              !subTypeGenericArgument.GenericParameterAttributes.HasFlag(GenericParameterAttributes.NotNullableValueTypeConstraint)) return false;
+
+          //not assignable if any of the constraints is not assignable to the constraints of the base type
+          if (baseTypeGenericArgument.GetGenericParameterConstraints().Any(baseTypeGenericParameterConstraint => !subTypeGenericArgument.GetGenericParameterConstraints().Any(t => baseTypeGenericParameterConstraint.IsAssignableFrom(t)))) {
+            return false;
+          }
         }
       }
Index: branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 13422)
@@ -34,5 +34,5 @@
   [Creatable(CreatableAttribute.Categories.Problems, Priority = 120)]
   [StorableClass]
-  public abstract class MultiObjectiveProgrammableProblem<TEncoding, TSolution> : MultiObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem
+  public class MultiObjectiveProgrammableProblem<TEncoding, TSolution> : MultiObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem
     where TEncoding : class, IEncoding<TSolution>
     where TSolution : class, ISolution {
@@ -66,4 +66,9 @@
       RegisterEvents();
     }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveProgrammableProblem<TEncoding, TSolution>(this, cloner);
+    }
+
     public MultiObjectiveProgrammableProblem()
       : base() {
@@ -71,4 +76,11 @@
         new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name }));
       ProblemScript.Encoding = (TEncoding)Encoding.Clone();
+
+      var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template;
+      codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, typeof(TEncoding).Namespace);
+      codeTemplate = codeTemplate.Replace(ENCODING_CLASS, typeof(TEncoding).Name);
+      codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, typeof(TSolution).Name);
+      ProblemScript.Code = codeTemplate;
+
       RegisterEvents();
     }
Index: branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 13422)
@@ -34,6 +34,7 @@
 namespace HeuristicLab.Problems.Programmable {
   [Item("Programmable Problem (single-objective)", "Represents a single-objective problem that can be programmed with a script.")]
+  [Creatable(CreatableAttribute.Categories.Problems, Priority = 110)]
   [StorableClass]
-  public abstract class SingleObjectiveProgrammableProblem<TEncoding, TSolution> : SingleObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem
+  public class SingleObjectiveProgrammableProblem<TEncoding, TSolution> : SingleObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem
     where TEncoding : class, IEncoding<TSolution>
     where TSolution : class, ISolution {
@@ -67,9 +68,20 @@
       RegisterEvents();
     }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveProgrammableProblem<TEncoding, TSolution>(this, cloner);
+    }
+
     public SingleObjectiveProgrammableProblem()
       : base() {
-      Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
-        new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name }));
+      Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name }));
       ProblemScript.Encoding = (TEncoding)Encoding.Clone();
+
+      var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template;
+      codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, typeof(TEncoding).Namespace);
+      codeTemplate = codeTemplate.Replace(ENCODING_CLASS, typeof(TEncoding).Name);
+      codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, typeof(TSolution).Name);
+      ProblemScript.Code = codeTemplate;
+
       Operators.Add(new BestScopeSolutionAnalyzer());
       RegisterEvents();
Index: branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.PluginInfraStructure-3.3/TypeExtensionsTest.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.PluginInfraStructure-3.3/TypeExtensionsTest.cs	(revision 13421)
+++ branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.PluginInfraStructure-3.3/TypeExtensionsTest.cs	(revision 13422)
@@ -36,25 +36,27 @@
     [TestProperty("Time", "short")]
     public void IsSubTypeOfTest() {
-      Assert.IsTrue(typeof(int).IsSubTypeOf(typeof(object)));
-      Assert.IsTrue(typeof(IntValue).IsSubTypeOf(typeof(IItem)));
-      Assert.IsTrue(typeof(List<int>).IsSubTypeOf(typeof(object)));
+      Assert.IsTrue(typeof(int).IsAssignableTo(typeof(object)));
+      Assert.IsTrue(typeof(IntValue).IsAssignableTo(typeof(IItem)));
+      Assert.IsTrue(typeof(List<int>).IsAssignableTo(typeof(object)));
 
-      Assert.IsTrue(typeof(List<int>).IsSubTypeOf(typeof(IList)));
-      Assert.IsTrue(typeof(List<>).IsSubTypeOf(typeof(IList)));
-      Assert.IsFalse(typeof(NamedItemCollection<>).IsSubTypeOf(typeof(ICollection<IItem>)));
-      Assert.IsFalse(typeof(NamedItemCollection<>).IsSubTypeOf(typeof(ICollection<NamedItem>)));
+      Assert.IsTrue(typeof(List<int>).IsAssignableTo(typeof(IList)));
+      Assert.IsTrue(typeof(List<>).IsAssignableTo(typeof(IList)));
+      Assert.IsFalse(typeof(NamedItemCollection<>).IsAssignableTo(typeof(ICollection<IItem>)));
+      Assert.IsFalse(typeof(NamedItemCollection<>).IsAssignableTo(typeof(ICollection<NamedItem>)));
+
+      //new tests      
 
 
-      Assert.IsTrue(typeof(List<IItem>).IsSubTypeOf(typeof(IList<IItem>)));
-      Assert.IsFalse(typeof(IList<IntValue>).IsSubTypeOf(typeof(IList<IItem>)));
-      Assert.IsTrue(typeof(List<IItem>).IsSubTypeOf(typeof(IList<IItem>)));
-      Assert.IsFalse(typeof(ItemList<>).IsSubTypeOf(typeof(IList<IItem>)));
-      Assert.IsFalse(typeof(ItemList<>).IsSubTypeOf(typeof(List<IItem>)));
+      Assert.IsTrue(typeof(List<IItem>).IsAssignableTo(typeof(IList<IItem>)));
+      Assert.IsFalse(typeof(IList<IntValue>).IsAssignableTo(typeof(IList<IItem>)));
+      Assert.IsTrue(typeof(List<IItem>).IsAssignableTo(typeof(IList<IItem>)));
+      Assert.IsFalse(typeof(ItemList<>).IsAssignableTo(typeof(IList<IItem>)));
+      Assert.IsFalse(typeof(ItemList<>).IsAssignableTo(typeof(List<IItem>)));
 
-      Assert.IsFalse(typeof(List<int>).IsSubTypeOf(typeof(List<>)));
-      Assert.IsTrue(typeof(List<>).IsSubTypeOf(typeof(IList<>)));
-      Assert.IsTrue(typeof(ItemList<>).IsSubTypeOf(typeof(IList<>)));
-      Assert.IsTrue(typeof(NamedItemCollection<>).IsSubTypeOf(typeof(IItemCollection<>)));
-      Assert.IsFalse(typeof(List<IntValue>).IsSubTypeOf(typeof(IList<>)));
+      Assert.IsTrue(typeof(List<int>).IsAssignableTo(typeof(List<>)));
+      Assert.IsTrue(typeof(List<>).IsAssignableTo(typeof(IList<>)));
+      Assert.IsTrue(typeof(ItemList<>).IsAssignableTo(typeof(IList<>)));
+      Assert.IsTrue(typeof(NamedItemCollection<>).IsAssignableTo(typeof(IItemCollection<>)));
+      Assert.IsTrue(typeof(List<IntValue>).IsAssignableTo(typeof(IList<>)));
     }
 
