Index: branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/ObjectEqualityComparer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/ObjectEqualityComparer.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/ObjectEqualityComparer.cs	(revision 9363)
@@ -0,0 +1,39 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Persistence.Mono {
+  #region Mono Compatibility
+  //work around mono's missing ObjectEqualityComparer
+  [Serializable]
+  public class ObjectEqualityComparer<T> : EqualityComparer<T> {
+    public override int GetHashCode(T obj) {
+      return EqualityComparer<T>.Default.GetHashCode(obj);
+    }
+    public override bool Equals(T a, T b) {
+      return EqualityComparer<T>.Default.Equals(a, b);
+    }
+  }
+  #endregion
+}
+
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/StringExtensions.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/StringExtensions.cs	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/StringExtensions.cs	(revision 9363)
@@ -1,3 +1,24 @@
-﻿using System.Collections.Generic;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
 
 namespace HeuristicLab.Persistence.Auxiliary {
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeLoader.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeLoader.cs	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeLoader.cs	(revision 9363)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Reflection;
 using HeuristicLab.Persistence.Core;
@@ -26,55 +27,165 @@
 
 namespace HeuristicLab.Persistence.Auxiliary {
+  internal class TypeLoader {
+    #region Mono Compatibility
+    private static TypeName cachedMonoRuntimeType;
+    private static TypeName cachedWindowsRuntimeType;
+    private static TypeName cachedMonoObjectEqualityComparerType;
+    private static TypeName cachedWindowsObjectEqualityComparerType;
 
-  internal class TypeLoader {
+    private static bool MonoInstalled {
+      get { return Type.GetType("Mono.Runtime") != null; }
+    }
+
+    static TypeLoader() {
+      // we use Int32 here because we get all the information about Mono's mscorlib and just have to change the class name
+      cachedMonoRuntimeType = TypeNameParser.Parse(typeof(System.Int32).AssemblyQualifiedName);
+      cachedMonoRuntimeType = new TypeName(cachedMonoRuntimeType, "MonoType");
+
+      cachedWindowsRuntimeType = TypeNameParser.Parse(typeof(System.Int32).AssemblyQualifiedName);
+      cachedWindowsRuntimeType = new TypeName(cachedWindowsRuntimeType, "RuntimeType");
+
+      // we need the information about the Persistence assembly, so we use TypeName here because it is contained in this assembly
+      cachedMonoObjectEqualityComparerType = TypeNameParser.Parse(typeof(TypeName).AssemblyQualifiedName);
+      cachedMonoObjectEqualityComparerType = new TypeName(cachedMonoObjectEqualityComparerType, "ObjectEqualityComparer", "HeuristicLab.Persistence.Mono");
+
+      cachedWindowsObjectEqualityComparerType = TypeNameParser.Parse(typeof(System.Int32).AssemblyQualifiedName);
+      cachedWindowsObjectEqualityComparerType = new TypeName(cachedWindowsObjectEqualityComparerType, "ObjectEqualityComparer", "System.Collections.Generic");
+    }
+    #endregion
 
     public static Type Load(string typeNameString) {
+      TypeName typeName = null;
+      try {
+        typeName = TypeNameParser.Parse(typeNameString);
+      }
+      catch (Exception) {
+        throw new PersistenceException(String.Format(
+           "Could not parse type string \"{0}\"",
+           typeNameString));
+      }
+
+      try {
+        // try to load type normally
+        return LoadInternal(typeName);
+      }
+      catch (PersistenceException) {
+        #region Mono Compatibility
+        // if that fails, try to convert to the corresponding Mono or .NET type
+        if (MonoInstalled) {
+          typeName = GetMonoType(typeName);
+          Logger.Info(String.Format(@"Trying to load Mono type ""{0}"" instead of .NET type ""{1}""",
+                                    typeName, typeNameString));
+        } else {
+          typeName = GetDotNetType(typeName);
+          Logger.Info(String.Format(@"Trying to load .NET type ""{0}"" instead of Mono type ""{1}""",
+                                    typeName, typeNameString));
+
+        }
+        return LoadInternal(typeName);
+        #endregion
+      }
+    }
+
+    private static Type LoadInternal(TypeName typeName) {
       Type type;
       try {
-        type = Type.GetType(typeNameString, true);
+        type = Type.GetType(typeName.ToString(true, true), true);
       }
       catch (Exception) {
         Logger.Warn(String.Format(
-          "Cannot load type \"{0}\", falling back to partial name", typeNameString));
-        try {
-          TypeName typeName = TypeNameParser.Parse(typeNameString);
-#pragma warning disable 0618
-          Assembly a = Assembly.LoadWithPartialName(typeName.AssemblyName);
-          // the suggested Assembly.Load() method fails to load assemblies outside the GAC
-#pragma warning restore 0618
-          type = a.GetType(typeName.ToString(false, false), true);
-        }
-        catch (Exception) {
-          throw new PersistenceException(String.Format(
-            "Could not load type \"{0}\"",
-            typeNameString));
-        }
-        try {
-          TypeName requestedTypeName = TypeNameParser.Parse(typeNameString);
-          TypeName loadedTypeName = TypeNameParser.Parse(type.AssemblyQualifiedName);
-          if (!requestedTypeName.IsCompatible(loadedTypeName))
-            throw new PersistenceException(String.Format(
-              "Serialized type is incompatible with available type: serialized: {0}, loaded: {1}",
-              typeNameString,
-              type.AssemblyQualifiedName));
-          if (requestedTypeName.IsNewerThan(loadedTypeName))
-            throw new PersistenceException(String.Format(
-              "Serialized type is newer than available type: serialized: {0}, loaded: {1}",
-              typeNameString,
-              type.AssemblyQualifiedName));
-        }
-        catch (PersistenceException) {
-          throw;
-        }
-        catch (Exception e) {
-          Logger.Warn(String.Format(
-            "Could not perform version check requested type was {0} while loaded type is {1}:",
-            typeNameString,
-            type.AssemblyQualifiedName),
-            e);
-        }
+          "Cannot load type \"{0}\", falling back to partial name", typeName.ToString(true, true)));
+        type = LoadWithPartialName(typeName);
+        CheckCompatibility(typeName, type);
       }
       return type;
     }
+
+    private static Type LoadWithPartialName(TypeName typeName) {
+      try {
+#pragma warning disable 0618
+        Assembly a = Assembly.LoadWithPartialName(typeName.AssemblyName);
+        // the suggested Assembly.Load() method fails to load assemblies outside the GAC
+#pragma warning restore 0618
+        return a.GetType(typeName.ToString(false, false), true);
+      }
+      catch (Exception) {
+        throw new PersistenceException(String.Format(
+          "Could not load type \"{0}\"",
+          typeName.ToString(true, true)));
+      }
+    }
+
+    private static void CheckCompatibility(TypeName typeName, Type type) {
+      try {
+        TypeName loadedTypeName = TypeNameParser.Parse(type.AssemblyQualifiedName);
+        if (!typeName.IsCompatible(loadedTypeName))
+          throw new PersistenceException(String.Format(
+            "Serialized type is incompatible with available type: serialized: {0}, loaded: {1}",
+            typeName.ToString(true, true),
+            type.AssemblyQualifiedName));
+        if (typeName.IsNewerThan(loadedTypeName))
+          throw new PersistenceException(String.Format(
+            "Serialized type is newer than available type: serialized: {0}, loaded: {1}",
+            typeName.ToString(true, true),
+            type.AssemblyQualifiedName));
+      }
+      catch (PersistenceException) {
+        throw;
+      }
+      catch (Exception e) {
+        Logger.Warn(String.Format(
+          "Could not perform version check requested type was {0} while loaded type is {1}:",
+          typeName.ToString(true, true),
+          type.AssemblyQualifiedName),
+                    e);
+      }
+    }
+
+    #region Mono Compatibility
+    /// <summary>
+    /// Returns the corresponding type for the Mono runtime
+    /// </summary>
+    /// <returns>
+    /// The remapped typeName, or the original typeName if no mapping was found
+    /// </returns>
+    private static TypeName GetMonoType(TypeName typeName) {
+      // map System.RuntimeType to System.MonoType
+      if (typeName.Namespace == "System" && typeName.ClassName == "RuntimeType") {
+        return cachedMonoRuntimeType;
+        // map System.Collections.Generic.ObjectEqualityComparer to HeuristicLab.Mono.ObjectEqualityComparer
+      } else if (typeName.Namespace == "System.Collections.Generic" && typeName.ClassName == "ObjectEqualityComparer") {
+        TypeName newTypeName = new TypeName(cachedMonoObjectEqualityComparerType);
+        newTypeName.GenericArgs = new List<TypeName>(typeName.GenericArgs);
+        return newTypeName;
+      }
+      return typeName;
+    }
+
+    /// <summary>
+    /// Returns the corresponding type for the .NET runtime
+    /// </summary>
+    /// <returns>
+    /// The remapped typeName, or the original typeName if no mapping was found
+    /// </returns>
+    private static TypeName GetDotNetType(TypeName typeName) {
+      // map System.MonoType to System.RuntimeType
+      if (typeName.Namespace == "System" && typeName.ClassName == "MonoType") {
+        return cachedWindowsRuntimeType;
+        // maps Mono's string comparer to System.Collections.Generic.ObjectEqualityComparer<string>
+      } else if (typeName.Namespace == "System.Collections.Generic" && typeName.ClassName == "InternalStringComparer") {
+        TypeName newTypeName = new TypeName(cachedWindowsObjectEqualityComparerType);
+        var genericArgsList = new List<TypeName>();
+        genericArgsList.Add(new TypeName(typeof(String).Namespace, "String"));
+        newTypeName.GenericArgs = genericArgsList;
+        return newTypeName;
+      } else if (typeName.Namespace == "System.Collections.Generic" && typeName.ClassName == "EqualityComparer+DefaultComparer") {
+        TypeName newTypeName = new TypeName(cachedWindowsObjectEqualityComparerType);
+        newTypeName.GenericArgs = new List<TypeName>(typeName.GenericArgs);
+        return newTypeName;
+      }
+      return typeName;
+    }
+    #endregion
   }
 }
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs	(revision 9363)
@@ -51,4 +51,11 @@
 
     /// <summary>
+    /// Gets or sets the number of generic args for
+    /// each class in a series of nested classes.
+    /// </summary>
+    [Storable]
+    public List<int> GenericArgCounts { get; private set; }
+
+      /// <summary>
     /// Gets or sets the generic args.
     /// </summary>
@@ -103,5 +110,5 @@
     /// <param name="nameSpace">The namespace.</param>
     /// <param name="className">Name of the class.</param>
-    internal TypeName(string nameSpace, string className) {
+    internal TypeName(string nameSpace, string className, List<int> genericArgCounts=null) {
       Namespace = nameSpace;
       ClassName = className;
@@ -109,6 +116,19 @@
       MemoryMagic = "";
       AssemblyAttribues = new Dictionary<string, string>();
-    }
-
+      if (genericArgCounts != null)
+        GenericArgCounts = genericArgCounts.ToList();
+    }
+
+    internal TypeName(TypeName typeName, string className = null, string nameSpace = null) {
+      Namespace = nameSpace ?? typeName.Namespace;
+      ClassName = className ?? typeName.ClassName;
+      GenericArgs = new List<TypeName>(typeName.GenericArgs);
+      AssemblyAttribues = new Dictionary<string, string>(typeName.AssemblyAttribues);
+      MemoryMagic = typeName.MemoryMagic;
+      AssemblyName = typeName.AssemblyName;
+      IsReference = typeName.IsReference;
+      if (typeName.GenericArgCounts != null)
+        GenericArgCounts = typeName.GenericArgCounts.ToList();
+    }
 
     /// <summary>
@@ -135,18 +155,22 @@
     /// </returns>
     public string ToString(bool full, bool includeAssembly) {
-      StringBuilder sb = new StringBuilder();
+      var sb = new StringBuilder();
       if (!string.IsNullOrEmpty(Namespace))
         sb.Append(Namespace).Append('.');
-      sb.Append(ClassName);
+      if (GenericArgCounts != null) {
+        sb.Append(string.Join("+",
+          ClassName
+          .Split('+')
+          .Zip(GenericArgCounts, (n, c) =>
+            c > 0 ? String.Format("{0}`{1}", n, c) : n)));
+      } else {
+        sb.Append(ClassName);
+        if (IsGeneric)
+          sb.Append('`').Append(GenericArgs.Count);
+      }
       if (IsGeneric) {
-        sb.Append('`').Append(GenericArgs.Count).Append('[');
-        bool first = true;
-        foreach (TypeName t in GenericArgs) {
-          if (first)
-            first = false;
-          else
-            sb.Append(',');
-          sb.Append('[').Append(t.ToString(full)).Append(']');
-        }
+        sb.Append('[');
+        sb.Append(String.Join(",", GenericArgs.Select(a =>
+          string.Format("[{0}]", a.ToString(full)))));
         sb.Append(']');
       }
@@ -161,17 +185,41 @@
     }
 
-    public string GetTypeNameInCode(HashSet<string> omitNamespaces) {
-      StringBuilder sb = new StringBuilder();
-      if (!string.IsNullOrEmpty(Namespace) && omitNamespaces == null || !omitNamespaces.Contains(Namespace))
-        sb.Append(Namespace).Append('.');
-      sb.Append(ClassName);
-      if (IsGeneric) {
-        sb.Append("<");
-        sb.Append(
-          string.Join(", ",
-            GenericArgs
-              .Select(a => a.GetTypeNameInCode(omitNamespaces))
-              .ToArray()));
-        sb.Append(">");
+    private IEnumerable<string> GetNestedClassesInCode(HashSet<string> omitNamespaces, bool includeAllNamespaces) {
+      var i = 0;
+      foreach (var pair in ClassName.Split('+').Zip(GenericArgCounts, (n, c) => new {n, c})) {
+        if (pair.c == 0) {
+          yield return pair.n;
+        }
+        else {
+          yield return string.Format("{0}<{1}>",
+            pair.n,
+            string.Join(",",
+              GenericArgs
+                .GetRange(i, pair.c)
+                .Select(a => a.GetTypeNameInCode(omitNamespaces, includeAllNamespaces))));
+          i += pair.c;
+        }
+      }
+    }
+
+    private string GetTypeNameInCode(HashSet<string> omitNamespaces, bool includeNamespaces) {
+      var sb = new StringBuilder();
+      if (!string.IsNullOrEmpty(Namespace) &&
+            (omitNamespaces == null && includeNamespaces) ||
+             omitNamespaces != null && !omitNamespaces.Contains(Namespace))
+          sb.Append(Namespace).Append('.');
+      if (GenericArgCounts != null) {
+        sb.Append(string.Join(".", GetNestedClassesInCode(omitNamespaces, includeNamespaces)));
+      } else {
+        sb.Append(ClassName);
+        if (IsGeneric) {
+          sb.Append("<");
+          sb.Append(
+            string.Join(", ",
+                        GenericArgs
+                          .Select(a => a.GetTypeNameInCode(omitNamespaces, includeNamespaces))
+                          .ToArray()));
+          sb.Append(">");
+        }
       }
       sb.Append(MemoryMagic);
@@ -179,20 +227,10 @@
     }
 
-    public string GetTypeNameInCode(bool includeAllNamespaces) {
-      StringBuilder sb = new StringBuilder();
-      if (includeAllNamespaces)
-        sb.Append(Namespace).Append('.');
-      sb.Append(ClassName);
-      if (IsGeneric) {
-        sb.Append("<");
-        sb.Append(
-          string.Join(", ",
-            GenericArgs
-              .Select(a => a.GetTypeNameInCode(includeAllNamespaces))
-              .ToArray()));
-        sb.Append(">");
-      }
-      sb.Append(MemoryMagic);
-      return sb.ToString();
+    public string GetTypeNameInCode(HashSet<string> omitNamespaces) {
+      return GetTypeNameInCode(omitNamespaces, false);
+    }
+
+    public string GetTypeNameInCode(bool includeNamespaces) {
+      return GetTypeNameInCode(null, includeNamespaces);
     }
 
@@ -235,5 +273,6 @@
         }
         return false;
-      } catch (KeyNotFoundException) {
+      }
+      catch (KeyNotFoundException) {
         throw new Exception("Could not extract version information from type string");
       }
@@ -272,5 +311,6 @@
         }
         return true;
-      } catch (KeyNotFoundException) {
+      }
+      catch (KeyNotFoundException) {
         throw new Exception("Could not extract version infomration from type string");
       }
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeNameParser.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeNameParser.cs	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Auxiliary/TypeNameParser.cs	(revision 9363)
@@ -22,4 +22,5 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
@@ -46,5 +47,5 @@
   /// 
   /// SimpleTypeSpec := (IDENTIFIER '.')*
-  ///                   (IDENTIFIER '+')*
+  ///                   (IDENTIFIER '`\d+'? '+')*
   ///                    IDENTIFIER
   ///                   ( '`\d+[' Generics ']' )?
@@ -69,11 +70,11 @@
 
       SimpleTypeSpec := (IDENTIFIER '.')*
-                        (IDENTIFIER '+')*
-                         IDENTIFIER
-                        ( '`\d+[' Generics ']' )?
+                        (IDENTIFIER '`\d+'?
+                        ( '+' IDENTIFIER '`\d+'? )*
+                        ( '[' Generics ']' )?
                         (\*|\[(\d+\.\.\d+|\d+\.\.\.|(|\*)(,(|\*))*)\])* 
                         (',\s*' IDENTIFIER (',\s*' AssemblyProperty)* )?
 
-      Generics := '[' SimpleTypeSpec ']' (',[' SimpleTypeSpec ']')
+      Generics := '[' SimpleTypeSpec ']' (',[' SimpleTypeSpec ']')*
 
       AssemblyProperty := 'Version=' Version
@@ -88,21 +89,22 @@
 
     private class Token {
-      private static Dictionary<string, string> tokens =
-        new Dictionary<string, string> {
-          {"-", "DASH"},
-          {"&", "AMPERSAND"},
-          {".", "DOT"},
-          {"+", "PLUS"},
-          {",", "COMMA"},
-          {"[", "OPEN_BRACKET"},
-          {"]", "CLOSE_BRACKET"},
-          {"*", "ASTERISK"},
-          {" ", "SPACE"},
-          {"=", "EQUALS"},
-          {"`", "BACKTICK"} };
-      private static Regex NumberRegex = new Regex("^\\d+$");
-      private static Regex IdentifierRegex = new Regex("^[_a-zA-Z][_a-zA-Z0-9]*$");
-      private static Regex TokenRegex = new Regex("[-&.+,\\[\\]* =`]|[a-f0-9]+|\\d+|[_a-zA-Z][_a-zA-Z0-9]*");
-      public string Name { get; private set; }
+      public enum Symbol { None, Dash, Ampersand, Dot, Plus, Comma, OpenBracket, CloseBracket, Asterisk, Space, Equals, Backtick }
+      private static readonly Dictionary<string, Symbol> TOKENS =
+        new Dictionary<string, Symbol> {
+          {"-", Symbol.Dash},
+          {"&", Symbol.Ampersand},
+          {".", Symbol.Dot},
+          {"+", Symbol.Plus},
+          {",", Symbol.Comma},
+          {"[", Symbol.OpenBracket},
+          {"]", Symbol.CloseBracket},
+          {"*", Symbol.Asterisk},
+          {" ", Symbol.Space},
+          {"=", Symbol.Equals},
+          {"`", Symbol.Backtick}};
+      private static readonly Regex NumberRegex = new Regex("^\\d+$");
+      private static readonly Regex IdentifierRegex = new Regex("^[_a-zA-Z][_a-zA-Z0-9]*$");
+      private static readonly Regex TokenRegex = new Regex("[-&.+,\\[\\]* =`]|[a-f0-9]+|\\d+|[_a-zA-Z][_a-zA-Z0-9]*");
+      public Symbol Name { get; private set; }
       public string Value { get; private set; }
       public bool IsIdentifier { get; private set; }
@@ -111,6 +113,7 @@
       private Token(string value, int pos) {
         Position = pos;
-        if (tokens.ContainsKey(value)) {
-          Name = tokens[value];
+        Name = Symbol.None;
+        if (TOKENS.ContainsKey(value)) {
+          Name = TOKENS[value];
         } else if (NumberRegex.IsMatch(value)) {
           Number = int.Parse(value);
@@ -128,5 +131,5 @@
       }
       public override string ToString() {
-        if (Name != null)
+        if (Name != Symbol.None)
           return "Token(" + Name + ")";
         if (Value != null)
@@ -154,5 +157,6 @@
     /// <summary>
     /// Parses the specified typename string as obtained by
-    /// <c>System.Object.GetType().FullName"</c>.
+    /// <c>System.Object.GetType().FullName</c> or 
+    /// <c>System.Object.GetType().AssemblyQualifiedName</c>.
     /// </summary>
     /// <param name="s">The typename string.</param>
@@ -181,43 +185,45 @@
     private TypeName TransformTypeSpec() {
       TypeName t = TransformSimpleTypeSpec();
-      t.IsReference = ConsumeToken("AMPERSAND");
+      t.IsReference = ConsumeToken(Token.Symbol.Ampersand);
       return t;
     }
 
     private TypeName TransformSimpleTypeSpec() {
-      List<string> nameSpace = new List<string>();
-      nameSpace.Add(ConsumeIdentifier());
-      while (ConsumeToken("DOT"))
+      var nameSpace = new List<string> { ConsumeIdentifier() };
+      while (ConsumeToken(Token.Symbol.Dot))
         nameSpace.Add(ConsumeIdentifier());
-      List<string> className = new List<string>();
+      var className = new List<string>();
       if (nameSpace.Count > 0) {
         className.Add(nameSpace[nameSpace.Count - 1]);
         nameSpace.RemoveAt(nameSpace.Count - 1);
       }
-      while (ConsumeToken("PLUS"))
+      var genericArgCounts = new List<int> {
+        ConsumeToken(Token.Symbol.Backtick) ? ConsumeNumber() : 0
+      };
+      while (ConsumeToken(Token.Symbol.Plus)) {
         className.Add(ConsumeIdentifier());
-      TypeName typeName = new TypeName(
+        genericArgCounts.Add(ConsumeToken(Token.Symbol.Backtick) ? ConsumeNumber() : 0);
+      }
+      var nGenericArgs = genericArgCounts.Sum();
+      var typeName = new TypeName(
         string.Join(".", nameSpace.ToArray()),
-        string.Join("+", className.ToArray()));
-      if (ConsumeToken("BACKTICK")) {
-        int nGenericArgs = ConsumeNumber();
-        if (ConsumeToken("OPEN_BRACKET") &&
-          CanConsumeToken("OPEN_BRACKET")) {
-          typeName.GenericArgs.AddRange(TransformGenerics());
-          ConsumeToken("CLOSE_BRACKET", true);
-        }
-      }
-      StringBuilder pointerOrArray = new StringBuilder();
+        string.Join("+", className.ToArray()),
+        nGenericArgs > genericArgCounts.Last() ? genericArgCounts : null);
+      if (nGenericArgs > 0 && ConsumeToken(Token.Symbol.OpenBracket, true)) {
+        typeName.GenericArgs.AddRange(TransformGenerics());
+        ConsumeToken(Token.Symbol.CloseBracket, true);
+      }
+      var pointerOrArray = new StringBuilder();
       while (true) {
-        if (ConsumeToken("ASTERSIK")) {
+        if (ConsumeToken(Token.Symbol.Asterisk)) {
           pointerOrArray.Append("*");
-        } else if (ConsumeToken("OPEN_BRACKET")) {
+        } else if (ConsumeToken(Token.Symbol.OpenBracket)) {
           pointerOrArray.Append('[');
           ParseDimension(pointerOrArray);
-          while (ConsumeToken("COMMA")) {
+          while (ConsumeToken(Token.Symbol.Comma)) {
             pointerOrArray.Append(",");
             ParseDimension(pointerOrArray);
           }
-          ConsumeToken("CLOSE_BRACKET", true);
+          ConsumeToken(Token.Symbol.CloseBracket, true);
           pointerOrArray.Append(']');
         } else {
@@ -227,13 +233,13 @@
       typeName.MemoryMagic = pointerOrArray.ToString();
       if (ConsumeComma()) {
-        StringBuilder sb = new StringBuilder();
+        var sb = new StringBuilder();
         sb.Append(ConsumeIdentifier());
-        while (CanConsumeToken("DOT") ||
-          CanConsumeToken("DASH") ||
+        while (CanConsumeToken(Token.Symbol.Dot) ||
+          CanConsumeToken(Token.Symbol.Dash) ||
           CanConsumeNumber() ||
           CanConsumeIdentifier()) {
-          if (ConsumeToken("DOT"))
+          if (ConsumeToken(Token.Symbol.Dot))
             sb.Append('.');
-          else if (ConsumeToken("DASH"))
+          else if (ConsumeToken(Token.Symbol.Dash))
             sb.Append('-');
           else if (CanConsumeNumber())
@@ -253,11 +259,11 @@
 
     private void ParseDimension(StringBuilder sb) {
-      if (ConsumeToken("ASTERSIK")) {
+      if (ConsumeToken(Token.Symbol.Asterisk)) {
         sb.Append("*");
       } else if (CanConsumeNumber()) {
         sb.Append(ConsumeNumber());
-        ConsumeToken("DOT", true);
-        ConsumeToken("DOT", true);
-        if (ConsumeToken("DOT")) {
+        ConsumeToken(Token.Symbol.Dot, true);
+        ConsumeToken(Token.Symbol.Dot, true);
+        if (ConsumeToken(Token.Symbol.Dot)) {
           sb.Append("...");
         } else {
@@ -268,11 +274,11 @@
 
     private IEnumerable<TypeName> TransformGenerics() {
-      ConsumeToken("OPEN_BRACKET", true);
+      ConsumeToken(Token.Symbol.OpenBracket, true);
       yield return TransformSimpleTypeSpec();
-      ConsumeToken("CLOSE_BRACKET", true);
-      while (ConsumeToken("COMMA")) {
-        ConsumeToken("OPEN_BRACKET", true);
+      ConsumeToken(Token.Symbol.CloseBracket, true);
+      while (ConsumeToken(Token.Symbol.Comma)) {
+        ConsumeToken(Token.Symbol.OpenBracket, true);
         yield return TransformSimpleTypeSpec();
-        ConsumeToken("CLOSE_BRACKET", true);
+        ConsumeToken(Token.Symbol.CloseBracket, true);
       }
     }
@@ -280,5 +286,5 @@
     private KeyValuePair<string, string> TransformAssemblyProperty() {
       if (ConsumeIdentifier("Version")) {
-        ConsumeToken("EQUALS", true);
+        ConsumeToken(Token.Symbol.Equals, true);
         return new KeyValuePair<string, string>(
           "Version",
@@ -300,5 +306,5 @@
 
     private KeyValuePair<string, string> ConsumeAssignment(string name) {
-      ConsumeToken("EQUALS", true);
+      ConsumeToken(Token.Symbol.Equals, true);
       return new KeyValuePair<string, string>(name, ConsumeToken());
     }
@@ -307,9 +313,9 @@
       StringBuilder version = new StringBuilder();
       version.Append(ConsumeNumber());
-      ConsumeToken("DOT");
+      ConsumeToken(Token.Symbol.Dot);
       version.Append('.').Append(ConsumeNumber());
-      ConsumeToken("DOT");
+      ConsumeToken(Token.Symbol.Dot);
       version.Append('.').Append(ConsumeNumber());
-      ConsumeToken("DOT");
+      ConsumeToken(Token.Symbol.Dot);
       version.Append('.').Append(ConsumeNumber());
       return version.ToString();
@@ -368,6 +374,6 @@
 
     private bool ConsumeComma() {
-      if (ConsumeToken("COMMA")) {
-        while (ConsumeToken("SPACE")) ;
+      if (ConsumeToken(Token.Symbol.Comma)) {
+        while (ConsumeToken(Token.Symbol.Space)) ;
         return true;
       } else {
@@ -376,25 +382,25 @@
     }
 
-    private bool ConsumeToken(string name) {
-      return ConsumeToken(name, false);
-    }
-
-    private bool CanConsumeToken(string name) {
-      if (tokens.Count == 0)
-        return false;
-      if (tokens.Peek().Name == name)
+    private bool ConsumeToken(Token.Symbol symbol) {
+      return ConsumeToken(symbol, false);
+    }
+
+    private bool CanConsumeToken(Token.Symbol symbol) {
+      if (tokens.Count == 0)
+        return false;
+      if (tokens.Peek().Name == symbol)
         return true;
       return false;
     }
 
-    private bool ConsumeToken(string name, bool force) {
+    private bool ConsumeToken(Token.Symbol symbol, bool force) {
       if (tokens.Count == 0)
         if (force)
           throw new ParseError(String.Format(
             "end of input while expecting token \"{0}\"",
-            name));
+            symbol));
         else
           return false;
-      if (tokens.Peek().Name == name) {
+      if (tokens.Peek().Name == symbol) {
         tokens.Dequeue();
         return true;
@@ -402,5 +408,5 @@
         throw new ParseError(String.Format(
           "expected \"{0}\" found \"{1}\"",
-          name,
+          symbol,
           tokens.Peek().ToString()));
       } else {
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs	(revision 8506)
+++ 	(revision )
@@ -1,262 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Persistence.Auxiliary;
-using HeuristicLab.Persistence.Core.Tokens;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence.Core {
-
-  /// <summary>
-  /// Core hub for deserialization. Reads the serialization token stream,
-  /// instantiates objects and fills in values.
-  /// </summary>
-  public class Deserializer {
-
-    /// <summary>
-    /// Helps in delivering the class instance and acts as proxy while
-    /// the object cannot yet be instantiate.
-    /// </summary>
-    private class Midwife {
-
-      public int? Id { get; private set; }
-      public bool MetaMode { get; set; }
-      public object Obj { get; private set; }
-
-      private List<Tag> metaInfo;
-      private List<Tag> customValues;
-      private Type type;
-      private ICompositeSerializer compositeSerializer;
-
-      public Midwife(object value) {
-        this.Obj = value;
-      }
-
-      public Midwife(Type type, ICompositeSerializer compositeSerializer, int? id) {
-        this.type = type;
-        this.compositeSerializer = compositeSerializer;
-        this.Id = id;
-        MetaMode = false;
-        metaInfo = new List<Tag>();
-        customValues = new List<Tag>();
-      }
-
-      public void CreateInstance() {
-        if (Obj != null)
-          throw new PersistenceException("object already instantiated");
-        Obj = compositeSerializer.CreateInstance(type, metaInfo);
-      }
-
-      public void AddValue(string name, object value) {
-        if (MetaMode) {
-          metaInfo.Add(new Tag(name, value));
-        } else {
-          customValues.Add(new Tag(name, value));
-        }
-      }
-
-      public void Populate() {
-        compositeSerializer.Populate(Obj, customValues, type);
-      }
-    }
-
-    private readonly Dictionary<int, object> id2obj;
-    private readonly Dictionary<Type, object> serializerMapping;
-    private readonly Stack<Midwife> parentStack;
-    private readonly Dictionary<int, Type> typeIds;
-    private Dictionary<Type, object> serializerInstances;
-
-    /// <summary>
-    /// Instantiates a new deserializer with the given type cache,
-    /// that contains information about the serializers to use
-    /// for every type and their type ids.
-    /// </summary>
-    /// <param name="typeCache">The type cache.</param>
-    public Deserializer(
-      IEnumerable<TypeMapping> typeCache) {
-      id2obj = new Dictionary<int, object>();
-      parentStack = new Stack<Midwife>();
-      typeIds = new Dictionary<int, Type>();
-      serializerMapping = new Dictionary<Type, object>();
-      serializerInstances = new Dictionary<Type, object>();
-      foreach (var typeMapping in typeCache) {
-        AddTypeInfo(typeMapping);
-      }
-    }
-
-    /// <summary>
-    /// Adds additionaly type information.
-    /// </summary>
-    /// <param name="typeMapping">The new type mapping.</param>
-    public void AddTypeInfo(TypeMapping typeMapping) {
-      if (typeIds.ContainsKey(typeMapping.Id))
-        return;
-      try {
-        Type type = TypeLoader.Load(typeMapping.TypeName);
-        typeIds.Add(typeMapping.Id, type);
-        Type serializerType = TypeLoader.Load(typeMapping.Serializer);
-        object serializer;
-        if (serializerInstances.ContainsKey(serializerType)) {
-          serializer = serializerInstances[serializerType];
-        } else {
-          serializer = Activator.CreateInstance(serializerType, true);
-          serializerInstances.Add(serializerType, serializer);
-        }
-        serializerMapping.Add(type, serializer);
-      } catch (PersistenceException) {
-        throw;
-      } catch (Exception e) {
-        throw new PersistenceException(string.Format(
-          "Could not add type info for {0} ({1})",
-          typeMapping.TypeName, typeMapping.Serializer), e);
-      }
-    }
-
-    /// <summary>
-    /// Process the token stream and deserialize an instantate a new object graph.
-    /// </summary>
-    /// <param name="tokens">The tokens.</param>
-    /// <returns>A fresh object filled with fresh data.</returns>
-    public object Deserialize(IEnumerable<ISerializationToken> tokens) {
-      foreach (ISerializationToken token in tokens) {
-        Type t = token.GetType();
-        if (t == typeof(BeginToken)) {
-          CompositeStartHandler((BeginToken)token);
-        } else if (t == typeof(EndToken)) {
-          CompositeEndHandler((EndToken)token);
-        } else if (t == typeof(PrimitiveToken)) {
-          PrimitiveHandler((PrimitiveToken)token);
-        } else if (t == typeof(ReferenceToken)) {
-          ReferenceHandler((ReferenceToken)token);
-        } else if (t == typeof(NullReferenceToken)) {
-          NullHandler((NullReferenceToken)token);
-        } else if (t == typeof(MetaInfoBeginToken)) {
-          MetaInfoBegin((MetaInfoBeginToken)token);
-        } else if (t == typeof(MetaInfoEndToken)) {
-          MetaInfoEnd((MetaInfoEndToken)token);
-        } else if (t == typeof(TypeToken)) {
-          Type((TypeToken)token);
-        } else {
-          throw new PersistenceException("invalid token type");
-        }
-      }
-      return parentStack.Pop().Obj;
-    }
-
-    private void InstantiateParent() {
-      if (parentStack.Count == 0)
-        return;
-      Midwife m = parentStack.Peek();
-      if (!m.MetaMode && m.Obj == null)
-        CreateInstance(m);
-    }
-
-    private void Type(TypeToken token) {
-      AddTypeInfo(new TypeMapping(token.Id, token.TypeName, token.Serializer));
-    }
-
-    private void CompositeStartHandler(BeginToken token) {
-      InstantiateParent();
-      Type type = typeIds[(int)token.TypeId];
-      try {
-        parentStack.Push(new Midwife(type, (ICompositeSerializer)serializerMapping[type], token.Id));
-      } catch (Exception e) {
-        if (e is InvalidCastException || e is KeyNotFoundException) {
-          throw new PersistenceException(String.Format(
-            "Invalid composite serializer configuration for type \"{0}\".",
-            type.AssemblyQualifiedName), e);
-        } else {
-          throw new PersistenceException(String.Format(
-            "Unexpected exception while trying to compose object of type \"{0}\".",
-            type.AssemblyQualifiedName), e);
-        }
-      }
-    }
-
-    private void CompositeEndHandler(EndToken token) {
-      Type type = typeIds[(int)token.TypeId];
-      Midwife midwife = parentStack.Pop();
-      if (midwife.Obj == null)
-        CreateInstance(midwife);
-      midwife.Populate();
-      SetValue(token.Name, midwife.Obj);
-    }
-
-    private void PrimitiveHandler(PrimitiveToken token) {
-      Type type = typeIds[(int)token.TypeId];
-      try {
-        object value = ((IPrimitiveSerializer)serializerMapping[type]).Parse(token.SerialData);
-        if (token.Id != null)
-          id2obj[(int)token.Id] = value;
-        SetValue(token.Name, value);
-      } catch (Exception e) {
-        if (e is InvalidCastException || e is KeyNotFoundException) {
-          throw new PersistenceException(String.Format(
-            "Invalid primitive serializer configuration for type \"{0}\".",
-            type.AssemblyQualifiedName), e);
-        } else {
-          throw new PersistenceException(String.Format(
-            "Unexpected exception while trying to parse object of type \"{0}\".",
-            type.AssemblyQualifiedName), e);
-        }
-      }
-    }
-
-    private void ReferenceHandler(ReferenceToken token) {
-      object referredObject = id2obj[token.Id];
-      SetValue(token.Name, referredObject);
-    }
-
-    private void NullHandler(NullReferenceToken token) {
-      SetValue(token.Name, null);
-    }
-
-    private void MetaInfoBegin(MetaInfoBeginToken token) {
-      parentStack.Peek().MetaMode = true;
-    }
-
-    private void MetaInfoEnd(MetaInfoEndToken token) {
-      Midwife m = parentStack.Peek();
-      m.MetaMode = false;
-      CreateInstance(m);
-    }
-
-    private void CreateInstance(Midwife m) {
-      m.CreateInstance();
-      if (m.Id != null)
-        id2obj.Add((int)m.Id, m.Obj);
-    }
-
-    private void SetValue(string name, object value) {
-      if (parentStack.Count == 0) {
-        parentStack.Push(new Midwife(value));
-      } else {
-        Midwife m = parentStack.Peek();
-        if (m.MetaMode == false && m.Obj == null) {
-          CreateInstance(m);
-        }
-        m.AddValue(name, value);
-      }
-    }
-  }
-}
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Core/Deserializer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Core/Deserializer.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Core/Deserializer.cs	(revision 9363)
@@ -0,0 +1,262 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Persistence.Auxiliary;
+using HeuristicLab.Persistence.Core.Tokens;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Core {
+
+  /// <summary>
+  /// Core hub for deserialization. Reads the serialization token stream,
+  /// instantiates objects and fills in values.
+  /// </summary>
+  public class Deserializer {
+
+    /// <summary>
+    /// Helps in delivering the class instance and acts as proxy while
+    /// the object cannot yet be instantiate.
+    /// </summary>
+    private class Midwife {
+
+      public int? Id { get; private set; }
+      public bool MetaMode { get; set; }
+      public object Obj { get; private set; }
+
+      private List<Tag> metaInfo;
+      private List<Tag> customValues;
+      private Type type;
+      private ICompositeSerializer compositeSerializer;
+
+      public Midwife(object value) {
+        this.Obj = value;
+      }
+
+      public Midwife(Type type, ICompositeSerializer compositeSerializer, int? id) {
+        this.type = type;
+        this.compositeSerializer = compositeSerializer;
+        this.Id = id;
+        MetaMode = false;
+        metaInfo = new List<Tag>();
+        customValues = new List<Tag>();
+      }
+
+      public void CreateInstance() {
+        if (Obj != null)
+          throw new PersistenceException("object already instantiated");
+        Obj = compositeSerializer.CreateInstance(type, metaInfo);
+      }
+
+      public void AddValue(string name, object value) {
+        if (MetaMode) {
+          metaInfo.Add(new Tag(name, value));
+        } else {
+          customValues.Add(new Tag(name, value));
+        }
+      }
+
+      public void Populate() {
+        compositeSerializer.Populate(Obj, customValues, type);
+      }
+    }
+
+    private readonly Dictionary<int, object> id2obj;
+    private readonly Dictionary<Type, object> serializerMapping;
+    private readonly Stack<Midwife> parentStack;
+    private readonly Dictionary<int, Type> typeIds;
+    private Dictionary<Type, object> serializerInstances;
+
+    /// <summary>
+    /// Instantiates a new deserializer with the given type cache,
+    /// that contains information about the serializers to use
+    /// for every type and their type ids.
+    /// </summary>
+    /// <param name="typeCache">The type cache.</param>
+    public Deserializer(
+      IEnumerable<TypeMapping> typeCache) {
+      id2obj = new Dictionary<int, object>();
+      parentStack = new Stack<Midwife>();
+      typeIds = new Dictionary<int, Type>();
+      serializerMapping = new Dictionary<Type, object>();
+      serializerInstances = new Dictionary<Type, object>();
+      foreach (var typeMapping in typeCache) {
+        AddTypeInfo(typeMapping);
+      }
+    }
+
+    /// <summary>
+    /// Adds additionaly type information.
+    /// </summary>
+    /// <param name="typeMapping">The new type mapping.</param>
+    public void AddTypeInfo(TypeMapping typeMapping) {
+      if (typeIds.ContainsKey(typeMapping.Id))
+        return;
+      try {
+        Type type = TypeLoader.Load(typeMapping.TypeName);
+        typeIds.Add(typeMapping.Id, type);
+        Type serializerType = TypeLoader.Load(typeMapping.Serializer);
+        object serializer;
+        if (serializerInstances.ContainsKey(serializerType)) {
+          serializer = serializerInstances[serializerType];
+        } else {
+          serializer = Activator.CreateInstance(serializerType, true);
+          serializerInstances.Add(serializerType, serializer);
+        }
+        serializerMapping.Add(type, serializer);
+      } catch (PersistenceException) {
+        throw;
+      } catch (Exception e) {
+        throw new PersistenceException(string.Format(
+          "Could not add type info for {0} ({1})",
+          typeMapping.TypeName, typeMapping.Serializer), e);
+      }
+    }
+
+    /// <summary>
+    /// Process the token stream and deserialize an instantate a new object graph.
+    /// </summary>
+    /// <param name="tokens">The tokens.</param>
+    /// <returns>A fresh object filled with fresh data.</returns>
+    public object Deserialize(IEnumerable<ISerializationToken> tokens) {
+      foreach (ISerializationToken token in tokens) {
+        Type t = token.GetType();
+        if (t == typeof(BeginToken)) {
+          CompositeStartHandler((BeginToken)token);
+        } else if (t == typeof(EndToken)) {
+          CompositeEndHandler((EndToken)token);
+        } else if (t == typeof(PrimitiveToken)) {
+          PrimitiveHandler((PrimitiveToken)token);
+        } else if (t == typeof(ReferenceToken)) {
+          ReferenceHandler((ReferenceToken)token);
+        } else if (t == typeof(NullReferenceToken)) {
+          NullHandler((NullReferenceToken)token);
+        } else if (t == typeof(MetaInfoBeginToken)) {
+          MetaInfoBegin((MetaInfoBeginToken)token);
+        } else if (t == typeof(MetaInfoEndToken)) {
+          MetaInfoEnd((MetaInfoEndToken)token);
+        } else if (t == typeof(TypeToken)) {
+          Type((TypeToken)token);
+        } else {
+          throw new PersistenceException("invalid token type");
+        }
+      }
+      return parentStack.Pop().Obj;
+    }
+
+    private void InstantiateParent() {
+      if (parentStack.Count == 0)
+        return;
+      Midwife m = parentStack.Peek();
+      if (!m.MetaMode && m.Obj == null)
+        CreateInstance(m);
+    }
+
+    private void Type(TypeToken token) {
+      AddTypeInfo(new TypeMapping(token.Id, token.TypeName, token.Serializer));
+    }
+
+    private void CompositeStartHandler(BeginToken token) {
+      InstantiateParent();
+      Type type = typeIds[(int)token.TypeId];
+      try {
+        parentStack.Push(new Midwife(type, (ICompositeSerializer)serializerMapping[type], token.Id));
+      } catch (Exception e) {
+        if (e is InvalidCastException || e is KeyNotFoundException) {
+          throw new PersistenceException(String.Format(
+            "Invalid composite serializer configuration for type \"{0}\".",
+            type.AssemblyQualifiedName), e);
+        } else {
+          throw new PersistenceException(String.Format(
+            "Unexpected exception while trying to compose object of type \"{0}\".",
+            type.AssemblyQualifiedName), e);
+        }
+      }
+    }
+
+    private void CompositeEndHandler(EndToken token) {
+      Type type = typeIds[(int)token.TypeId];
+      Midwife midwife = parentStack.Pop();
+      if (midwife.Obj == null)
+        CreateInstance(midwife);
+      midwife.Populate();
+      SetValue(token.Name, midwife.Obj);
+    }
+
+    private void PrimitiveHandler(PrimitiveToken token) {
+      Type type = typeIds[(int)token.TypeId];
+      try {
+        object value = ((IPrimitiveSerializer)serializerMapping[type]).Parse(token.SerialData);
+        if (token.Id != null)
+          id2obj[(int)token.Id] = value;
+        SetValue(token.Name, value);
+      } catch (Exception e) {
+        if (e is InvalidCastException || e is KeyNotFoundException) {
+          throw new PersistenceException(String.Format(
+            "Invalid primitive serializer configuration for type \"{0}\".",
+            type.AssemblyQualifiedName), e);
+        } else {
+          throw new PersistenceException(String.Format(
+            "Unexpected exception while trying to parse object of type \"{0}\".",
+            type.AssemblyQualifiedName), e);
+        }
+      }
+    }
+
+    private void ReferenceHandler(ReferenceToken token) {
+      object referredObject = id2obj[token.Id];
+      SetValue(token.Name, referredObject);
+    }
+
+    private void NullHandler(NullReferenceToken token) {
+      SetValue(token.Name, null);
+    }
+
+    private void MetaInfoBegin(MetaInfoBeginToken token) {
+      parentStack.Peek().MetaMode = true;
+    }
+
+    private void MetaInfoEnd(MetaInfoEndToken token) {
+      Midwife m = parentStack.Peek();
+      m.MetaMode = false;
+      CreateInstance(m);
+    }
+
+    private void CreateInstance(Midwife m) {
+      m.CreateInstance();
+      if (m.Id != null)
+        id2obj.Add((int)m.Id, m.Obj);
+    }
+
+    private void SetValue(string name, object value) {
+      if (parentStack.Count == 0) {
+        parentStack.Push(new Midwife(value));
+      } else {
+        Midwife m = parentStack.Peek();
+        if (m.MetaMode == false && m.Obj == null) {
+          CreateInstance(m);
+        }
+        m.AddValue(name, value);
+      }
+    }
+  }
+}
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Core/Tokens/NulLReferenceToken.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Core/Tokens/NulLReferenceToken.cs	(revision 8506)
+++ 	(revision )
@@ -1,37 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-
-namespace HeuristicLab.Persistence.Core.Tokens {
-
-  /// <summary>
-  /// Describes a reference to <c>null</c>.
-  /// </summary>
-  public class NullReferenceToken : SerializationTokenBase {
-
-    /// <summary>
-    /// Initializes a new instance of the <see cref="NullReferenceToken"/> class.
-    /// </summary>
-    /// <param name="name">The token name.</param>
-    public NullReferenceToken(string name) : base(name) { }
-  }
-
-}
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Core/Tokens/NullReferenceToken.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Core/Tokens/NullReferenceToken.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Core/Tokens/NullReferenceToken.cs	(revision 9363)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Persistence.Core.Tokens {
+
+  /// <summary>
+  /// Describes a reference to <c>null</c>.
+  /// </summary>
+  public class NullReferenceToken : SerializationTokenBase {
+
+    /// <summary>
+    /// Initializes a new instance of the <see cref="NullReferenceToken"/> class.
+    /// </summary>
+    /// <param name="name">The token name.</param>
+    public NullReferenceToken(string name) : base(name) { }
+  }
+
+}
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs	(revision 9363)
@@ -41,10 +41,15 @@
 
     public bool CanSerialize(Type type) {
+      #region Mono Compatibility
       return type == typeof(Type) ||
-             type.VersionInvariantName() == "System.RuntimeType, mscorlib";
+        type.VersionInvariantName() == "System.RuntimeType, mscorlib" ||
+        type.VersionInvariantName() == "System.MonoType, mscorlib";
+      #endregion
     }
 
     public string JustifyRejection(Type type) {
-      return "not System.Type nor System.RuntimeType";
+      #region Mono Compatibility
+      return "not System.Type, System.RuntimeType, System.MonoType";
+      #endregion
     }
 
Index: branches/OaaS/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj	(revision 9363)
@@ -125,4 +125,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Auxiliary\ObjectEqualityComparer.cs" />
     <Compile Include="Auxiliary\StringExtensions.cs" />
     <Compile Include="Auxiliary\TypeLoader.cs" />
@@ -246,5 +247,5 @@
   </ItemGroup>
   <PropertyGroup>
-    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
 set ProjectDir=$(ProjectDir)
 set SolutionDir=$(SolutionDir)
@@ -252,4 +253,10 @@
 
 call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
 </PreBuildEvent>
     <PostBuildEvent>
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Plugin.cs.frame
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Plugin.cs.frame	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Plugin.cs.frame	(revision 9363)
@@ -27,5 +27,5 @@
   /// The plugin for HeuriticLab.Persistence
   /// </summary>
-  [Plugin("HeuristicLab.Persistence", "3.3.6.$WCREV$")]
+  [Plugin("HeuristicLab.Persistence", "3.3.7.$WCREV$")]
   [PluginFile("HeuristicLab.Persistence-3.3.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Tracing", "3.3")]
Index: branches/OaaS/HeuristicLab.Persistence/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/OaaS/HeuristicLab.Persistence/3.3/Properties/AssemblyInfo.cs.frame	(revision 8506)
+++ branches/OaaS/HeuristicLab.Persistence/3.3/Properties/AssemblyInfo.cs.frame	(revision 9363)
@@ -52,3 +52,3 @@
 //
 [assembly: AssemblyVersion("3.3.0.0")]
-[assembly: AssemblyFileVersion("3.3.6.$WCREV$")]
+[assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
