diff --git a/include/aidge/graph/Node.hpp b/include/aidge/graph/Node.hpp
index a16bbd63ecf52e8c97d5032c5c90a5f69186f995..50be8ada385d8697e8601b1959794098c25442be 100644
--- a/include/aidge/graph/Node.hpp
+++ b/include/aidge/graph/Node.hpp
@@ -229,10 +229,10 @@ public:
       if ((inputCategory(i) == InputCategory::Data || inputCategory(i) == InputCategory::OptionalData)
         && input(i).second == gk_IODefaultIndex)
       {
-        break;
+        return i;
       }
     }
-    return (i < nbInputs()) ? i : gk_IODefaultIndex;
+    return gk_IODefaultIndex;
   }
 
 
diff --git a/src/graph/Node.cpp b/src/graph/Node.cpp
index 92ae463085a3583dfe894a1b9f6119fa0b099287..7406f289585a76886c41d5fa61b47d92af31bab0 100644
--- a/src/graph/Node.cpp
+++ b/src/graph/Node.cpp
@@ -145,7 +145,9 @@ bool Aidge::Node::valid() const {
 Aidge::IOIndex_t Aidge::Node::getNbFreeDataInputs() const {
     IOIndex_t nbFreeDataIn = 0;
     for (IOIndex_t i = 0; i < nbInputs(); ++i) {
-        if (input(i).second == gk_IODefaultIndex) {
+        if ((inputCategory(i) == InputCategory::Data
+             || inputCategory(i) == InputCategory::OptionalData)
+            && input(i).second == gk_IODefaultIndex) {
             ++nbFreeDataIn;
         }
     }
@@ -285,10 +287,17 @@ void Aidge::Node::addChild(std::shared_ptr<Node> otherNode, const IOIndex_t outI
 void Aidge::Node::addChild(std::shared_ptr<GraphView> otherView, const IOIndex_t outId,
                            std::pair<std::shared_ptr<Node>, IOIndex_t> otherInId) {
     if (!otherInId.first) {
-        AIDGE_ASSERT(otherView->inputNodes().size() == 1U,
+        AIDGE_ASSERT(otherView->getNbFreeDataInputs() == 1U,
             "Input node of GraphView {} need to be specified, because it has more than one input ({} inputs), when trying to add it as a child of node {} (of type {})",
             otherView->name(), otherView->inputNodes().size(), name(), type());
-        otherInId.first = *(otherView->inputNodes().begin());
+
+        otherInId.first = *(std::find_if(
+            otherView->inputNodes().begin(),
+            otherView->inputNodes().end(),
+            [](const auto &node) {
+                return node->getFirstFreeDataInput() != gk_IODefaultIndex;
+            }
+        ));
     }
     otherInId.second = (otherInId.second != gk_IODefaultIndex)
                                ? otherInId.second