schema tree BUGFIX input/output nodes should not be skipped
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index 72357c9..9d46ffe 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -881,7 +881,7 @@
                 } else if (node->nodetype == LYS_NOTIF) {
                     iter = (struct lysc_node *)lysc_node_notifs(node->parent);
                 } else {
-                    iter = (struct lysc_node *)lysc_node_children(node->parent, node->flags & LYS_IS_OUTPUT);
+                    iter = (struct lysc_node *)lysc_node_child(node->parent);
                 }
                 LY_CHECK_ERR_RET(!iter, LOGINT(ctx), );
             } else if (node->nodetype == LYS_RPC) {
@@ -902,7 +902,7 @@
             } else if (node->nodetype == LYS_NOTIF) {
                 child_p = (struct lysc_node **)lysc_node_notifs_p(node->parent);
             } else {
-                child_p = lysc_node_children_p(node->parent, node->flags & LYS_IS_OUTPUT);
+                child_p = lysc_node_child_p(node->parent);
             }
         } else if (node->nodetype == LYS_RPC) {
             child_p = (struct lysc_node **)&node->module->compiled->rpcs;