diff --git a/BaseLib/ConfigTreeNew-impl.h b/BaseLib/ConfigTreeNew-impl.h
index fc3213d6d9a11f38b59378ed763871613089e913..fa006aa0db7a223ebefaa23d22d8e24246337985 100644
--- a/BaseLib/ConfigTreeNew-impl.h
+++ b/BaseLib/ConfigTreeNew-impl.h
@@ -144,10 +144,11 @@ ConfigTreeNew::
 getConfAttribute(std::string const& attr) const
 {
     checkUniqueAttr(attr);
-    markVisited<T>(attr, true);
+    auto& ct = markVisited<T>(attr, true, true);
 
     if (auto attrs = _tree->get_child_optional("<xmlattr>")) {
         if (auto a = attrs->get_child_optional(attr)) {
+            ++ct.count; // count only if attribute has been found
             if (auto v = a->get_value_optional<T>()) {
                 return *v;
             } else {
@@ -156,7 +157,7 @@ getConfAttribute(std::string const& attr) const
                       + "' not convertible to the desired type.");
             }
         } else {
-            error("No XML attribute named \"" + attr + "\"");
+            error("Did not find XML attribute with name \"" + attr + "\"");
         }
     } else {
         error("This parameter has no XML attributes");
diff --git a/BaseLib/ConfigTreeNew.cpp b/BaseLib/ConfigTreeNew.cpp
index 67aef29c99c49767b058dde991a253c0558bf64d..8d461e2233a0c04485d1b94d124e935ed6c96c57 100644
--- a/BaseLib/ConfigTreeNew.cpp
+++ b/BaseLib/ConfigTreeNew.cpp
@@ -85,6 +85,16 @@ getConfParam(std::string const& root) const
     return ct;
 }
 
+boost::optional<ConfigTreeNew>
+ConfigTreeNew::
+getConfParamOptional(std::string const& root) const
+{
+    auto ct = getConfSubtreeOptional(root);
+    if (ct && hasChildren(*ct))
+        error("Requested parameter <" + root + "> actually is a subtree.");
+    return ct;
+}
+
 ConfigTreeNew
 ConfigTreeNew::
 getConfSubtree(std::string const& root) const