diff --git a/src/tree_schema.c b/src/tree_schema.c
index 21fc337..cabccb2 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -53,7 +53,7 @@
                 next = last = (const struct lysc_node*)&((struct lysc_node_choice*)parent)->cases[0];
             } else {
                 snode = lysc_node_children_p(parent, (options & LYS_GETNEXT_OUTPUT) ? LYS_CONFIG_R : LYS_CONFIG_W);
-                /* do not return anything if the augment does not have any children */
+                /* do not return anything if the node does not have any children */
                 if (!snode || !(*snode)) {
                     return NULL;
                 }
@@ -66,15 +66,12 @@
         if (!next) {
             /* try to get action or notification */
             goto repeat;
-        } else if (!(options & LYS_GETNEXT_NOSTATECHECK)) {
-            if (!lys_is_disabled(next, 0)) {
-                return next;
-            }
-            /* continue to find next available node */
-        } else {
-            return next;
         }
+        /* test if the next can be returned */
+        goto check;
+
     } else if (last->nodetype == LYS_ACTION) {
+        action_flag = 1;
         if (last->parent) {
             actions = lysc_node_actions(last->parent);
         } else {
@@ -90,6 +87,7 @@
         }
         goto repeat;
     } else if (last->nodetype == LYS_NOTIF) {
+        action_flag = notif_flag = 1;
         if (last->parent) {
             notifs = lysc_node_notifs(last->parent);
         } else {
@@ -115,7 +113,7 @@
     }
     if (!next) {
         /* possibly go back to parent */
-        if (last->parent != parent) {
+        if (last && last->parent != parent) {
             last = last->parent;
             next = last->next;
         } else if (!action_flag) {
@@ -129,6 +127,7 @@
         }
         goto repeat;
     }
+check:
     switch (next->nodetype) {
     case LYS_ACTION:
     case LYS_NOTIF:
@@ -158,7 +157,7 @@
         } else {
             /* go into */
             if (options & LYS_GETNEXT_WITHCASE) {
-                next = (struct lysc_node*)&((struct lysc_node_choice *)next)->cases;
+                next = (struct lysc_node*)((struct lysc_node_choice *)next)->cases;
             } else {
                 next = ((struct lysc_node_choice *)next)->cases->child;
             }
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index c2a6a54..bbf0d9b 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -3082,6 +3082,12 @@
     struct lysp_node *child_p;
     unsigned int u;
 
+    if (options & LYSC_OPT_RPC_MASK) {
+        LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
+               "Action \"%s\" is placed inside another RPC/action.", action_p->name);
+        return LY_EVALID;
+    }
+
     action->nodetype = LYS_ACTION;
     action->module = ctx->mod;
     action->parent = parent;
@@ -3104,14 +3110,14 @@
     COMPILE_ARRAY_GOTO(ctx, action_p->input.musts, action->input.musts, options, u, lys_compile_must, ret, cleanup);
     COMPILE_ARRAY_GOTO(ctx, action_p->input.exts, action->input.exts, options, u, lys_compile_ext, ret, cleanup);
     LY_LIST_FOR(action_p->input.data, child_p) {
-        LY_CHECK_RET(lys_compile_node(ctx, child_p, options & LYSC_OPT_RPC_INPUT, (struct lysc_node*)action, uses_status));
+        LY_CHECK_RET(lys_compile_node(ctx, child_p, options | LYSC_OPT_RPC_INPUT, (struct lysc_node*)action, uses_status));
     }
 
     /* output */
     COMPILE_ARRAY_GOTO(ctx, action_p->output.musts, action->output.musts, options, u, lys_compile_must, ret, cleanup);
     COMPILE_ARRAY_GOTO(ctx, action_p->output.exts, action->output.exts, options, u, lys_compile_ext, ret, cleanup);
     LY_LIST_FOR(action_p->output.data, child_p) {
-        LY_CHECK_RET(lys_compile_node(ctx, child_p, options & LYSC_OPT_RPC_OUTPUT, (struct lysc_node*)action, uses_status));
+        LY_CHECK_RET(lys_compile_node(ctx, child_p, options | LYSC_OPT_RPC_OUTPUT, (struct lysc_node*)action, uses_status));
     }
 
 cleanup:
@@ -3728,17 +3734,18 @@
  * @param[in] parent Parent node holding the children list, in case of node from a choice's case,
  * the choice itself is expected instead of a specific case node.
  * @param[in] node Schema node to connect into the list.
+ * @param[in] options Compile options to distinguish input/output when placing node into RPC/action.
  * @return LY_ERR value - LY_SUCCESS or LY_EEXIST.
  */
 static LY_ERR
-lys_compile_node_connect(struct lysc_ctx *ctx, struct lysc_node *parent, struct lysc_node *node)
+lys_compile_node_connect(struct lysc_ctx *ctx, struct lysc_node *parent, struct lysc_node *node, int options)
 {
     struct lysc_node **children;
 
     if (node->nodetype == LYS_CASE) {
         children = (struct lysc_node**)&((struct lysc_node_choice*)parent)->cases;
     } else {
-        children = lysc_node_children_p(parent, node->flags);
+        children = lysc_node_children_p(parent, options);
     }
     if (children) {
         if (!(*children)) {
@@ -3848,7 +3855,7 @@
     cs->module = ctx->mod;
     cs->prev = (struct lysc_node*)cs;
     cs->nodetype = LYS_CASE;
-    lys_compile_node_connect(ctx, (struct lysc_node*)ch, (struct lysc_node*)cs);
+    lys_compile_node_connect(ctx, (struct lysc_node*)ch, (struct lysc_node*)cs, options);
     cs->parent = (struct lysc_node*)ch;
     cs->child = child;
 
@@ -4094,10 +4101,10 @@
 
         /* compile the children */
         if (node_p->nodetype != LYS_CASE) {
-            LY_CHECK_RET(lys_compile_node(ctx, node_p, options, target, 0));
+            LY_CHECK_RET(lys_compile_node(ctx, node_p, options | flags, target, 0));
         } else {
             LY_LIST_FOR(((struct lysp_node_case *)node_p)->child, case_node_p) {
-                LY_CHECK_RET(lys_compile_node(ctx, case_node_p, options, target, 0));
+                LY_CHECK_RET(lys_compile_node(ctx, case_node_p, options | flags, target, 0));
             }
         }
 
@@ -4140,13 +4147,13 @@
 
     switch (target->nodetype) {
     case LYS_CONTAINER:
-        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_container*)node)->actions, target,
-                            options, u, lys_compile_action, 0, ret, error);
+        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_container*)target)->actions, target,
+                            options | flags, u, lys_compile_action, 0, ret, error);
         /* TODO notifications */
         break;
     case LYS_LIST:
-        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_list*)node)->actions, target,
-                            options, u, lys_compile_action, 0, ret, error);
+        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_list*)target)->actions, target,
+                            options | flags, u, lys_compile_action, 0, ret, error);
         /* TODO notifications */
         break;
     default:
@@ -4753,7 +4760,7 @@
         } else { /* other than choice */
             node->parent = parent;
         }
-        LY_CHECK_RET(lys_compile_node_connect(ctx, parent->nodetype == LYS_CASE ? parent->parent : parent, node), LY_EVALID);
+        LY_CHECK_RET(lys_compile_node_connect(ctx, parent->nodetype == LYS_CASE ? parent->parent : parent, node, options), LY_EVALID);
     } else {
         /* top-level element */
         if (!ctx->mod->compiled->data) {
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 6b89cb3..f5b9174 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -95,6 +95,7 @@
     const struct lys_module *mod;
     const char *nodeid_type;
     int getnext_extra_flag = 0;
+    int current_nodetype = 0;
 
     assert(nodeid);
     assert(target);
@@ -147,11 +148,15 @@
             /* move through input/output manually */
             if (!strncmp("input", name, name_len)) {
                 (*result_flag) |= LYSC_OPT_RPC_INPUT;
-            } else if (!strncmp("input", name, name_len)) {
+            } else if (!strncmp("output", name, name_len)) {
                 (*result_flag) |= LYSC_OPT_RPC_OUTPUT;
                 getnext_extra_flag = LYS_GETNEXT_OUTPUT;
+            } else {
+                goto getnext;
             }
+            current_nodetype = LYS_INOUT;
         } else {
+getnext:
             context_node = lys_child(context_node, mod, name, name_len, 0,
                                      getnext_extra_flag | LYS_GETNEXT_NOSTATECHECK | LYS_GETNEXT_WITHCHOICE | LYS_GETNEXT_WITHCASE);
             if (!context_node) {
@@ -160,8 +165,9 @@
                 return LY_ENOTFOUND;
             }
             getnext_extra_flag = 0;
+            current_nodetype = context_node->nodetype;
 
-            if (context_node->nodetype == LYS_NOTIF) {
+            if (current_nodetype == LYS_NOTIF) {
                 (*result_flag) |= LYSC_OPT_NOTIFICATION;
             }
         }
@@ -179,7 +185,10 @@
 
     if (ret == LY_SUCCESS) {
         *target = context_node;
-        if (nodetype && !(context_node->nodetype & nodetype)) {
+        if (nodetype & LYS_INOUT) {
+            /* instead of input/output nodes, the RPC/action node is actually returned */
+        }
+        if (nodetype && !(current_nodetype & nodetype)) {
             return LY_EDENIED;
         }
     } else {
