diff --git a/pages/docs/compiler.md b/pages/docs/compiler.md
index 130020ad63b878c254bfa8f8fc6db82e71a3414d..ccff6d6c05f7544ff75caeda4f19a6f87c765ad9 100644
--- a/pages/docs/compiler.md
+++ b/pages/docs/compiler.md
@@ -75,8 +75,9 @@ However, depending on the selected protocols and/or used features, additional de
 - Required runtime dependencies: _none_
 - Required options for RelAST compiler: _none_
 - Required options for JastAdd:
-    - `--incremental`
-    - `--tracing=flush`
+    - `--incremental=param` (enable incremental evaluation)
+    - `--tracing=flush` (enable tracing of events)
+    - `--cache=all` (set all attributes to be cached)
 - Remarks:
     - Other (additional) values passed to those two options must be equal (e.g., `--incremental=param` passed to RagConnect must be also passed to JastAdd)
     - Other values besides `flush` can be added to `--tracing`
diff --git a/ragconnect.base/src/main/jastadd/Intermediate.jadd b/ragconnect.base/src/main/jastadd/Intermediate.jadd
index 97cc5148e9e6901d8a1b23cc965adbd57a7c0d44..b847dc7251eefc0eaac7ca456111374d0af1dd02 100644
--- a/ragconnect.base/src/main/jastadd/Intermediate.jadd
+++ b/ragconnect.base/src/main/jastadd/Intermediate.jadd
@@ -398,7 +398,7 @@ aspect MustacheReceiveAndSendAndHandleUri {
   syn String PortDefinition.connectParameterName() = "uriString";
 
   syn String PortDefinition.disconnectMethodName() {
-    // if both (send and receive) are defined for an port, ensure methods with different names
+    // if both (send and receive) are defined for a port, ensure methods with different names
     String extra;
     if (getPortTarget().isTokenPortTarget()) {
       extra = lookupTokenPortDefinitions(token()).size() > 1 ? uniqueSuffix() : "";
@@ -681,7 +681,7 @@ aspect MustacheTypeDecl {
   syn List<TypeComponent> TypeDecl.occurencesInProductionRules() {
     List<TypeComponent> result = new ArrayList<>();
     for (TypeDecl typeDecl : program().typeDecls()) {
-      for (Component comp : typeDecl.getComponentList()) {
+      for (Component comp : typeDecl.allComponentsAsOwnedByMe()) {
         if (comp.isTypeComponent() && comp.asTypeComponent().getTypeDecl().equals(this)) {
           result.add(comp.asTypeComponent());
         }
diff --git a/ragconnect.base/src/main/jastadd/NameResolution.jrag b/ragconnect.base/src/main/jastadd/NameResolution.jrag
index 6e7c74576f1a6ef68d045733cc59a6b6368a2246..eb589e10774f0149ca868061073fddd91d558ccb 100644
--- a/ragconnect.base/src/main/jastadd/NameResolution.jrag
+++ b/ragconnect.base/src/main/jastadd/NameResolution.jrag
@@ -27,7 +27,7 @@ aspect RagConnectNameResolution {
     java.util.List<PortDefinition> result = new java.util.ArrayList<>();
     for (PortDefinition def : onlyGiven ? givenPortDefinitionList() : allPortDefinitionList()) {
       PortTarget target = def.getPortTarget();
-      if (target.isTypePortTarget() && target.asTypePortTarget().getType().equals(type)) {
+      if (target.isTypePortTarget() && target.asTypePortTarget().getType().matches(type) && target.asTypePortTarget().getType().containingTypeDecl().equals(type.containingTypeDecl())) {
         result.add(def);
       }
     }
@@ -216,9 +216,7 @@ aspect RelastNameResolution {
     if (!other.isTokenComponent()) { return false; }
     return getName().equals(other.getName()) && getJavaTypeUse().prettyPrint().equals(other.asTokenComponent().getJavaTypeUse().prettyPrint());
   }
-  eq TypeComponent.matches(Component other) {
-    return getName().equals(other.getName()) && getTypeDecl().equals(other.asTypeComponent().getTypeDecl());
-  }
+  eq TypeComponent.matches(Component other) = matchesNameAndType(other);
   eq NormalComponent.matches(Component other) {
     if (!other.isTypeComponent() || !other.asTypeComponent().isNormalComponent()) { return false; }
     return super.matches(other);
@@ -231,4 +229,7 @@ aspect RelastNameResolution {
     if (!other.isTypeComponent() || !other.asTypeComponent().isOptComponent()) { return false; }
     return super.matches(other);
   }
+  syn boolean TypeComponent.matchesNameAndType(Component other) {
+    return getName().equals(other.getName()) && getTypeDecl().equals(other.asTypeComponent().getTypeDecl());
+  }
 }
diff --git a/ragconnect.base/src/main/resources/RagConnectObserver.mustache b/ragconnect.base/src/main/resources/RagConnectObserver.mustache
index 24ed61c1a2ed6ceabec733b45f76a51eeae5f1e0..67ba811a3afebd4d7144a053fefb2aeb9c47611c 100644
--- a/ragconnect.base/src/main/resources/RagConnectObserver.mustache
+++ b/ragconnect.base/src/main/resources/RagConnectObserver.mustache
@@ -119,8 +119,8 @@ aspect RagConnectObserver {
         }
         RagConnectObserverStartEntry startEntry = startEntries.peekFirst();
         if (node == startEntry.node &&
-            attribute == startEntry.attributeString &&
-            value == startEntry.flushIncToken) {
+            attribute.equals(startEntry.attributeString) &&
+            value.equals(startEntry.flushIncToken)) {
           // create a copy of the queue to avoid entering this again causing an endless recursion
           RagConnectObserverEntry[] entriesToProcess = entryQueue.toArray(new RagConnectObserverEntry[entryQueue.size()]);
           entryQueue.clear();
diff --git a/ragconnect.base/src/main/resources/ragconnect.mustache b/ragconnect.base/src/main/resources/ragconnect.mustache
index 5bd0166a46bb6f02be2df10a2bfd26b9cc63d508..a38ac9b3151227d92dffb83365eef8a1ab27f49e 100644
--- a/ragconnect.base/src/main/resources/ragconnect.mustache
+++ b/ragconnect.base/src/main/resources/ragconnect.mustache
@@ -91,6 +91,7 @@ aspect RagConnect {
     mayHaveRewrite();
     // check if --incremental is active
     Object checkIncremental = inc_throwAway_visited;
+    {{! TODO maybe check for something like _ragconnect_mqttHandler_computed to see if --cache=all }}
   {{/configIncrementalOptionActive}}
   }
 }