diff --git a/models/samples/ComputerSystem/expected_src/Computer.hh b/models/samples/ComputerSystem/expected_src/Computer.hh
index 896aabb..8f734b8 100644
--- a/models/samples/ComputerSystem/expected_src/Computer.hh
+++ b/models/samples/ComputerSystem/expected_src/Computer.hh
@@ -17,6 +17,8 @@
 struct UMLRTSlot;
 
 #include "ResourceType.hh"
+#include "umlrttimerid.hh"
+#include "umlrttimespec.hh"
 
 #include <iostream>
 #include <iomanip>
diff --git a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp.rts/src/org/eclipse/papyrusrt/codegen/cpp/rts/UMLRTRuntime.java b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp.rts/src/org/eclipse/papyrusrt/codegen/cpp/rts/UMLRTRuntime.java
index ca34ad4..d512801 100644
--- a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp.rts/src/org/eclipse/papyrusrt/codegen/cpp/rts/UMLRTRuntime.java
+++ b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp.rts/src/org/eclipse/papyrusrt/codegen/cpp/rts/UMLRTRuntime.java
@@ -7,6 +7,7 @@
  *******************************************************************************/
 package org.eclipse.papyrusrt.codegen.cpp.rts;
 
+import org.eclipse.papyrusrt.codegen.lang.cpp.Element;
 import org.eclipse.papyrusrt.codegen.lang.cpp.Expression;
 import org.eclipse.papyrusrt.codegen.lang.cpp.Name;
 import org.eclipse.papyrusrt.codegen.lang.cpp.Type;
@@ -31,6 +32,7 @@
 import org.eclipse.papyrusrt.codegen.lang.cpp.external.StandardLibrary;
 import org.eclipse.papyrusrt.codegen.utils.RTSModelLibraryUtils;
 import org.eclipse.papyrusrt.codegen.utils.XTUMLRTUtil;
+import org.eclipse.papyrusrt.xtumlrt.common.NamedElement;
 import org.eclipse.papyrusrt.xtumlrt.common.Protocol;
 import org.eclipse.papyrusrt.xtumlrt.common.Signal;
 
@@ -785,11 +787,29 @@
             return UMLRTTimerId.getType();
         if( RTSModelLibraryUtils.isTimerSpec( type ) )
             return UMLRTTimespec.getType();
-        return null;
-    }
+		if (RTSModelLibraryUtils.isMessage(type))
+			return UMLRTMessage.getType();
+		return null;
+	}
+
+	/**
+	 * Return the system-defined cpp element of the given element and null if
+	 * the type is not recognized.
+	 */
+	public static Element getSystemElement(NamedElement element) {
+		if (RTSModelLibraryUtils.isCapsuleId(element))
+			return UMLRTCapsuleId.Element;
+		if (RTSModelLibraryUtils.isTimerId(element))
+			return UMLRTTimerId.Element;
+		if (RTSModelLibraryUtils.isTimerSpec(element))
+			return UMLRTTimespec.Element;
+		if (RTSModelLibraryUtils.isMessage(element))
+			return UMLRTMessage.Element;
+		return null;
+	}
 
     /**
-     * Return the Type of the given system-defined protocol and null if the protocol is not recognized. 
+     * Return the Type of the given system-defined protocol and null if the protocol is not recognized.
      */
     public static Type getSystemProtocolRole( Protocol protocol, boolean baseRole )
     {
diff --git a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/CppCodePattern.java b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/CppCodePattern.java
index dadac42..201f65e 100644
--- a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/CppCodePattern.java
+++ b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/CppCodePattern.java
@@ -647,6 +647,9 @@
 
     public Element getCppElement( NamedElement element )
     {
+		if (RTSModelLibraryUtils.isSystemElement(element)) {
+			return UMLRTRuntime.getSystemElement(element);
+		}
         if( element instanceof org.eclipse.papyrusrt.xtumlrt.common.Capsule )
             return getCppClass( Output.CapsuleClass, element );
         else if( element instanceof org.eclipse.papyrusrt.xtumlrt.common.StructuredType )
diff --git a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/internal/BasicClassGenerator.java b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/internal/BasicClassGenerator.java
index d510e8e..3d85ddc 100644
--- a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/internal/BasicClassGenerator.java
+++ b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.cpp/src/org/eclipse/papyrusrt/codegen/cpp/internal/BasicClassGenerator.java
@@ -71,7 +71,6 @@
 import org.eclipse.papyrusrt.codegen.lang.cpp.stmt.UserCode;
 import org.eclipse.papyrusrt.codegen.utils.CodeGenUtils;
 import org.eclipse.papyrusrt.codegen.utils.QualifiedNames;
-import org.eclipse.papyrusrt.codegen.utils.RTSModelLibraryUtils;
 import org.eclipse.papyrusrt.codegen.xtumlrt.trans.RTCppGenerationProperties;
 import org.eclipse.papyrusrt.xtumlrt.common.AbstractAction;
 import org.eclipse.papyrusrt.xtumlrt.common.ActionCode;
@@ -511,8 +510,7 @@
                     Element cppElement = cpp.getCppElement( supplier );
                     if( cppElement != null )
                     {
-						if (depKindInHead == null && depKindInImpl == null
-								&& !RTSModelLibraryUtils.isSystemElement(supplier)) {
+						if (depKindInHead == null && depKindInImpl == null) {
 							depKindInHead = DependencyKind.INCLUSION;
 						}
                         cppDependencyInHead = getDependency( cppElement, supplier, depKindInHead );
diff --git a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.utils/src/org/eclipse/papyrusrt/codegen/utils/RTSModelLibraryUtils.xtend b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.utils/src/org/eclipse/papyrusrt/codegen/utils/RTSModelLibraryUtils.xtend
index 0f9a1af..be0198f 100644
--- a/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.utils/src/org/eclipse/papyrusrt/codegen/utils/RTSModelLibraryUtils.xtend
+++ b/plugins/umlrt/codegen/org.eclipse.papyrusrt.codegen.utils/src/org/eclipse/papyrusrt/codegen/utils/RTSModelLibraryUtils.xtend
@@ -7,21 +7,24 @@
  *******************************************************************************/
 package org.eclipse.papyrusrt.codegen.utils
 
-import org.eclipse.emf.ecore.util.EcoreUtil
 import org.eclipse.emf.common.util.URI
 import org.eclipse.emf.ecore.resource.Resource
 import org.eclipse.emf.ecore.resource.ResourceSet
-import org.eclipse.uml2.uml.UMLPackage
+import org.eclipse.emf.ecore.util.EcoreUtil
 import org.eclipse.papyrusrt.codegen.CodeGenPlugin
 import org.eclipse.papyrusrt.xtumlrt.common.CommonElement
-import org.eclipse.papyrusrt.xtumlrt.common.NamedElement
-import org.eclipse.papyrusrt.xtumlrt.common.Signal
-import org.eclipse.papyrusrt.xtumlrt.common.Protocol
+import org.eclipse.papyrusrt.xtumlrt.common.CommonFactory
 import org.eclipse.papyrusrt.xtumlrt.common.Model
-import org.eclipse.papyrusrt.xtumlrt.common.Type
+import org.eclipse.papyrusrt.xtumlrt.common.NamedElement
+import org.eclipse.papyrusrt.xtumlrt.common.Protocol
+import org.eclipse.papyrusrt.xtumlrt.common.Signal
+import org.eclipse.uml2.uml.Collaboration
+import org.eclipse.uml2.uml.Element
+import org.eclipse.uml2.uml.Package
+import org.eclipse.uml2.uml.UMLPackage
+
 import static extension org.eclipse.papyrusrt.codegen.utils.UMLRealTimeProfileUtil.*
 import static extension org.eclipse.papyrusrt.codegen.utils.XTUMLRTUtil.*
-import org.eclipse.papyrusrt.xtumlrt.common.CommonFactory
 
 class RTSModelLibraryUtils
 {
@@ -66,15 +69,16 @@
     public static val TIMER_ID_TYPE_NAME    = "UMLRTTimerId"
     public static val TIME_SPEC_TYPE_NAME   = "UMLRTTimespec"
     public static val TIME_SPEC_2_TYPE_NAME = "UMLRTTimeSpec"
-
+    public static val MESSAGE_TYPE_NAME     = "UMLRTMessage"
+    
     /** Packages */
     public static val INTERNAL_PACKAGE_NAME  = "Internal"
 
     /** Protocol elements */
-    private static var org.eclipse.uml2.uml.Collaboration FRAME_PROTOCOL    = null
-    private static var org.eclipse.uml2.uml.Collaboration TIMING_PROTOCOL   = null
-    private static var org.eclipse.uml2.uml.Collaboration LOG_PROTOCOL      = null
-    private static var org.eclipse.uml2.uml.Collaboration BASECOMM_PROTOCOL = null
+    private static var Collaboration FRAME_PROTOCOL    = null
+    private static var Collaboration TIMING_PROTOCOL   = null
+    private static var Collaboration LOG_PROTOCOL      = null
+    private static var Collaboration BASECOMM_PROTOCOL = null
 
     /** Protocol message elements: Timing */
     private static var TIMEOUT_MESSAGE   = null
@@ -110,12 +114,12 @@
             return null
         }
         val eobj = EcoreUtil.getObjectByType( contents, UMLPackage.Literals.PACKAGE )
-        if (eobj === null || !(eobj instanceof org.eclipse.uml2.uml.Package))
+        if (eobj === null || !(eobj instanceof Package))
         {
             CodeGenPlugin.warning( "Unable to load package " + fullURI.toPlatformString(true) + "; first element is null or not a UML Package" )
             return null
         }
-        val pkg = eobj as org.eclipse.uml2.uml.Package
+        val pkg = eobj as Package
         return pkg
     }
 
@@ -180,15 +184,14 @@
         RTSModelLibrary
     }
 
-    static def getProtocol( org.eclipse.uml2.uml.Package packge, String name )
+    static def getProtocol( Package packge, String name )
     {
         val protocolContainer = packge.getPackagedElement( name )
-        if (protocolContainer !== null && protocolContainer instanceof org.eclipse.uml2.uml.Package)
+        if (protocolContainer !== null && protocolContainer instanceof Package)
         {
-            val protocol = (protocolContainer as org.eclipse.uml2.uml.Package).getPackagedElement( name )
-            if (protocol !== null && protocol instanceof org.eclipse.uml2.uml.Collaboration)
-                protocol as org.eclipse.uml2.uml.Collaboration
-            
+            val protocol = (protocolContainer as Package).getPackagedElement( name )
+            if (protocol !== null && protocol instanceof Collaboration)
+                protocol as Collaboration
         }
     }
 
@@ -224,7 +227,7 @@
         if (BASECOMM_PROTOCOL === null || reload)
         {
             val internalPackage = RTSModelLibrary.getPackagedElement( INTERNAL_PACKAGE_NAME )
-            if (internalPackage instanceof org.eclipse.uml2.uml.Package)
+            if (internalPackage instanceof Package)
                 BASECOMM_PROTOCOL = getProtocol( internalPackage, BASECOMM_PROTOCOL_NAME )
         }
         BASECOMM_PROTOCOL
@@ -267,7 +270,7 @@
     /**
      * Returns true iff the given UML model is the model library.
      */
-    static def boolean isRTSModelLibrary( org.eclipse.uml2.uml.Package packge )
+    static def boolean isRTSModelLibrary( Package packge )
     {
         if (packge == RTSModelLibrary) return true
         val uriConverter = packge.eResource.resourceSet.URIConverter
@@ -303,13 +306,13 @@
         && (element as NamedElement).hasSysAnnotation
     }
 
-    static def boolean isSystemElement( org.eclipse.uml2.uml.Element element )
+    static def boolean isSystemElement( Element element )
     {
         element.model !== null
         && element.model.isRTSModelLibrary
     }
 
-    static def isCapsuleId( Type type )
+    static def isCapsuleId( NamedElement type )
     {
         type !== null && type.name !== null
         && type.name == CAPSULE_ID_TYPE_NAME
@@ -335,19 +338,24 @@
         && isTextualRTSModelLibrary( element.root as Model )
     }
 
-    static def isTimerId( Type type )
+    static def isTimerId( NamedElement type )
     {
         type !== null && type.name !== null
         && type.name == TIMER_ID_TYPE_NAME
         && isSystemElement( type )
     }
 
-    static def isTimerSpec( Type type )
+    static def isTimerSpec( NamedElement type )
     {
         type !== null && type.name !== null
         && (type.name == TIME_SPEC_2_TYPE_NAME || type.name == TIME_SPEC_TYPE_NAME)  // TODO Until Bug 469218 is resolved
         && isSystemElement( type )
     }
+    
+    static def isMessage(NamedElement type) {
+        type !== null && type.name !== null 
+        && type.name == MESSAGE_TYPE_NAME && isSystemElement(type)
+    }
 
     static def isBaseCommProtocol( Protocol protocol )
     {
