Index: /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjectiveOptimizationSupportScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjectiveOptimizationSupportScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjectiveOptimizationSupportScript.cs	(revision 13218)
@@ -30,13 +30,8 @@
   [StorableClass]
   public sealed class MultiObjectiveOptimizationSupportScript : OptimizationSupportScript<IMultiObjectiveOptimizationSupport>, IMultiObjectiveOptimizationSupport {
-
-    protected override string CodeTemplate {
-      get { return Templates.CompiledMultiObjectiveOptimizationSupport; }
-    }
-
     [StorableConstructor]
     private MultiObjectiveOptimizationSupportScript(bool deserializing) : base(deserializing) { }
     private MultiObjectiveOptimizationSupportScript(MultiObjectiveOptimizationSupportScript original, Cloner cloner) : base(original, cloner) { }
-    public MultiObjectiveOptimizationSupportScript() : base() { }
+    public MultiObjectiveOptimizationSupportScript() : base(Templates.CompiledMultiObjectiveOptimizationSupport) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
Index: /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/OptimizationSupportScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/OptimizationSupportScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/OptimizationSupportScript.cs	(revision 13218)
@@ -46,4 +46,9 @@
     protected OptimizationSupportScript()
       : base() {
+      variableStore = new VariableStore();
+    }
+
+    protected OptimizationSupportScript(string code)
+      : base(code) {
       variableStore = new VariableStore();
     }
Index: /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjectiveOptimizationSupportScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjectiveOptimizationSupportScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjectiveOptimizationSupportScript.cs	(revision 13218)
@@ -31,13 +31,8 @@
   [StorableClass]
   public sealed class SingleObjectiveOptimizationSupportScript : OptimizationSupportScript<ISingleObjectiveOptimizationSupport>, ISingleObjectiveOptimizationSupport {
-
-    protected override string CodeTemplate {
-      get { return Templates.CompiledSingleObjectiveOptimizationSupport; }
-    }
-
     [StorableConstructor]
     private SingleObjectiveOptimizationSupportScript(bool deserializing) : base(deserializing) { }
     private SingleObjectiveOptimizationSupportScript(SingleObjectiveOptimizationSupportScript original, Cloner cloner) : base(original, cloner) { }
-    public SingleObjectiveOptimizationSupportScript() : base() { }
+    public SingleObjectiveOptimizationSupportScript() : base(Templates.CompiledSingleObjectiveOptimizationSupport) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
Index: /trunk/sources/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs	(revision 13218)
@@ -31,8 +31,4 @@
     public string Filename { get; set; }
 
-    protected override string CodeTemplate {
-      get { return ScriptTemplates.CompiledMultiObjectiveProblemDefinition; }
-    }
-
     private new IMultiObjectiveProblemDefinition CompiledProblemDefinition {
       get { return (IMultiObjectiveProblemDefinition)base.CompiledProblemDefinition; }
@@ -41,10 +37,6 @@
     [StorableConstructor]
     private MultiObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
-    private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript original, Cloner cloner)
-      : base(original, cloner) { }
-
-    public MultiObjectiveProblemDefinitionScript() {
-      Code = CodeTemplate;
-    }
+    private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledMultiObjectiveProblemDefinition) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
Index: /trunk/sources/HeuristicLab.Problems.Programmable/3.3/ProblemDefinitionScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Programmable/3.3/ProblemDefinitionScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Problems.Programmable/3.3/ProblemDefinitionScript.cs	(revision 13218)
@@ -53,4 +53,8 @@
     protected ProblemDefinitionScript()
       : base() {
+      variableStore = new VariableStore();
+    }
+    protected ProblemDefinitionScript(string code)
+      : base(code) {
       variableStore = new VariableStore();
     }
Index: /trunk/sources/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs	(revision 13218)
@@ -32,8 +32,4 @@
     public string Filename { get; set; }
 
-    protected override string CodeTemplate {
-      get { return ScriptTemplates.CompiledSingleObjectiveProblemDefinition; }
-    }
-
     private new ISingleObjectiveProblemDefinition CompiledProblemDefinition {
       get { return (ISingleObjectiveProblemDefinition)base.CompiledProblemDefinition; }
@@ -43,8 +39,5 @@
     private SingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
     private SingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript original, Cloner cloner) : base(original, cloner) { }
-    public SingleObjectiveProblemDefinitionScript()
-      : base() {
-      Code = CodeTemplate;
-    }
+    public SingleObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledSingleObjectiveProblemDefinition) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
Index: /trunk/sources/HeuristicLab.Scripting/3.3/ExecutableScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Scripting/3.3/ExecutableScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Scripting/3.3/ExecutableScript.cs	(revision 13218)
@@ -52,10 +52,9 @@
       executionTime = original.executionTime;
     }
-    public ExecutableScript()
+    protected ExecutableScript()
       : base() {
       executionTime = TimeSpan.Zero;
-      Code = CodeTemplate;
     }
-    public ExecutableScript(string code)
+    protected ExecutableScript(string code)
       : base(code) {
       executionTime = TimeSpan.Zero;
@@ -85,4 +84,5 @@
         timer.Elapsed -= timer_Elapsed;
         timer.Stop();
+        timer.Dispose();
         ExecutionTime += DateTime.UtcNow - lastUpdateTime;
         Running = false;
Index: /trunk/sources/HeuristicLab.Scripting/3.3/Script.cs
===================================================================
--- /trunk/sources/HeuristicLab.Scripting/3.3/Script.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Scripting/3.3/Script.cs	(revision 13218)
@@ -37,9 +37,5 @@
 namespace HeuristicLab.Scripting {
   [StorableClass]
-  public class Script : NamedItem, IProgrammableItem {
-    protected virtual string CodeTemplate {
-      get { return string.Empty; }
-    }
-
+  public abstract class Script : NamedItem, IProgrammableItem {
     #region Fields & Properties
     public static new Image StaticItemImage {
@@ -77,28 +73,14 @@
         compileErrors = new CompilerErrorCollection(original.compileErrors);
     }
-    public Script()
+    protected Script()
       : base("Script", "An empty script.") {
-      code = CodeTemplate;
     }
-    public Script(string code)
+    protected Script(string code)
       : this() {
       this.code = code;
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Script(this, cloner);
     }
     #endregion
 
     #region Compilation
-    protected virtual CSharpCodeProvider CodeProvider {
-      get {
-        return new CSharpCodeProvider(
-          new Dictionary<string, string> {
-                {"CompilerVersion", "v4.0"}, // support C# 4.0 syntax
-              });
-      }
-    }
-
     protected virtual CompilerResults DoCompile() {
       var parameters = new CompilerParameters {
@@ -114,5 +96,10 @@
         .ToArray());
 
-      return CodeProvider.CompileAssemblyFromSource(parameters, code);
+      var codeProvider = new CSharpCodeProvider(
+        new Dictionary<string, string> {
+          { "CompilerVersion", "v4.0"} // support C# 4.0 syntax
+        });
+
+      return codeProvider.CompileAssemblyFromSource(parameters, code);
     }
 
Index: /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs
===================================================================
--- /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs	(revision 13217)
+++ /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs	(revision 13218)
@@ -32,8 +32,4 @@
   [StorableClass]
   public class CSharpScript : ExecutableScript, IStorableContent {
-    #region Constants
-    protected override string CodeTemplate { get { return ScriptTemplates.CSharpScriptTemplate; } }
-    #endregion
-
     #region Fields & Properties
     private CSharpScriptBase compiledScript;
@@ -56,5 +52,5 @@
     }
     public CSharpScript()
-      : base() {
+      : base(ScriptTemplates.CSharpScriptTemplate) {
       variableStore = new VariableStore();
     }
