Index: trunk/sources/HeuristicLab.Parameters/3.3/LookupParameter.cs
===================================================================
--- trunk/sources/HeuristicLab.Parameters/3.3/LookupParameter.cs	(revision 14036)
+++ trunk/sources/HeuristicLab.Parameters/3.3/LookupParameter.cs	(revision 14037)
@@ -50,6 +50,6 @@
     public string TranslatedName {
       get {
-        string translatedName;
-        GetValueParameterAndTranslateName(out translatedName);
+        string translatedName = Name;
+        GetValueParameterAndTranslateName(ExecutionContext, ref translatedName);
         return translatedName;
       }
@@ -61,6 +61,7 @@
 
     private Lazy<ThreadLocal<IItem>> cachedActualValues;
-    private IItem CachedActualValue {
+    protected IItem CachedActualValue {
       get { return cachedActualValues.Value.Value; }
+      set { cachedActualValues.Value.Value = value; }
     }
 
@@ -128,18 +129,17 @@
     }
 
-    private IValueParameter GetValueParameterAndTranslateName(out string actualName) {
+    protected static IValueParameter GetValueParameterAndTranslateName(IExecutionContext executionContext, ref string translatedName) {
       IValueParameter valueParam;
       ILookupParameter lookupParam;
-      IExecutionContext currentExecutionContext = ExecutionContext;
-
-      actualName = Name;
+      IExecutionContext currentExecutionContext = executionContext;
+
       while (currentExecutionContext != null) {
-        valueParam = currentExecutionContext.Parameters[actualName] as IValueParameter;
-        lookupParam = currentExecutionContext.Parameters[actualName] as ILookupParameter;
+        valueParam = currentExecutionContext.Parameters[translatedName] as IValueParameter;
+        lookupParam = currentExecutionContext.Parameters[translatedName] as ILookupParameter;
 
         if ((valueParam == null) && (lookupParam == null))
           throw new InvalidOperationException(
             string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\" or an \"{2}\".",
-                          actualName, typeof(IValueParameter).GetPrettyName(), typeof(ILookupParameter).GetPrettyName())
+                          translatedName, typeof(IValueParameter).GetPrettyName(), typeof(ILookupParameter).GetPrettyName())
           );
 
@@ -148,27 +148,34 @@
           else if (lookupParam == null) return valueParam;
         }
-        if (lookupParam != null) actualName = lookupParam.ActualName;
+        if (lookupParam != null) translatedName = lookupParam.ActualName;
 
         currentExecutionContext = currentExecutionContext.Parent;
-        while ((currentExecutionContext != null) && !currentExecutionContext.Parameters.ContainsKey(actualName))
+        while ((currentExecutionContext != null) && !currentExecutionContext.Parameters.ContainsKey(translatedName))
           currentExecutionContext = currentExecutionContext.Parent;
       }
       return null;
     }
-    private IVariable LookupVariable(string name) {
-      IScope scope = ExecutionContext.Scope;
+    protected static IVariable LookupVariable(IScope scope, string name) {
       while ((scope != null) && !scope.Variables.ContainsKey(name))
         scope = scope.Parent;
       return scope != null ? scope.Variables[name] : null;
     }
+
     protected override IItem GetActualValue() {
       if (CachedActualValue != null) return CachedActualValue;
-      string name;
+
+      string translatedName = Name;
+      var value = GetValue(ExecutionContext, ref translatedName);
+      CachedActualValue = value;
+      return value;
+    }
+
+    protected static IItem GetValue(IExecutionContext executionContext, ref string name) {
       // try to get value from context stack
-      IValueParameter param = GetValueParameterAndTranslateName(out name);
+      IValueParameter param = GetValueParameterAndTranslateName(executionContext, ref name);
       if (param != null) return param.Value;
 
       // try to get variable from scope
-      IVariable var = LookupVariable(name);
+      IVariable var = LookupVariable(executionContext.Scope, name);
       if (var != null) {
         if (!(var.Value is T))
@@ -178,9 +185,9 @@
                           typeof(T).GetPrettyName())
           );
-        cachedActualValues.Value.Value = var.Value;
         return var.Value;
       }
       return null;
     }
+
     protected override void SetActualValue(IItem value) {
       if (!(value is T))
@@ -189,9 +196,13 @@
                         typeof(T).GetPrettyName())
         );
-      cachedActualValues.Value.Value = value;
-
+      CachedActualValue = value;
+
+      string translatedName = Name;
+      SetValue(ExecutionContext, ref translatedName, value);
+    }
+
+    protected static void SetValue(IExecutionContext executionContext, ref string name, IItem value) {
       // try to set value in context stack
-      string name;
-      IValueParameter param = GetValueParameterAndTranslateName(out name);
+      IValueParameter param = GetValueParameterAndTranslateName(executionContext, ref name);
       if (param != null) {
         param.Value = value;
@@ -200,5 +211,5 @@
 
       // try to set value in scope
-      IVariable var = LookupVariable(name);
+      IVariable var = LookupVariable(executionContext.Scope, name);
       if (var != null) {
         var.Value = value;
@@ -207,5 +218,5 @@
 
       // create new variable
-      ExecutionContext.Scope.Variables.Add(new Variable(name, value));
+      executionContext.Scope.Variables.Add(new Variable(name, value));
     }
 
