schema compile BUGFIX nodetype checking for augments
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index 182ed09..18f13cb 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -3988,7 +3988,8 @@
         /* check if the subnode can be connected to the found target (e.g. case cannot be inserted into container) */
         if (!(target->nodetype == LYS_CHOICE && node_p->nodetype == LYS_CASE)
                 && !((target->nodetype & (LYS_CONTAINER | LYS_LIST)) && (node_p->nodetype & (LYS_ACTION | LYS_NOTIF)))
-                && !(node_p->nodetype & (LYS_ANYDATA | LYS_CONTAINER | LYS_CHOICE | LYS_LEAF | LYS_LIST | LYS_LEAFLIST | LYS_USES))) {
+                && !(target->nodetype != LYS_CHOICE && node_p->nodetype == LYS_USES)
+                && !(node_p->nodetype & (LYS_ANYDATA | LYS_CONTAINER | LYS_CHOICE | LYS_LEAF | LYS_LIST | LYS_LEAFLIST))) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                    "Invalid augment (%s) of %s node which is not allowed to contain %s node \"%s\".",
                    aug_p->nodeid, lys_nodetype2str(target->nodetype), lys_nodetype2str(node_p->nodetype), node_p->name);