diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index 14dafbc..4417027 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -53,9 +53,9 @@
 
 #define COMPILE_ARRAY_GOTO(CTX, ARRAY_P, ARRAY_C, ITER, FUNC, RET, GOTO) \
     if (ARRAY_P) { \
-        LY_ARRAY_CREATE_GOTO((CTX)->ctx, ARRAY_C, LY_ARRAY_SIZE(ARRAY_P), RET, GOTO); \
-        LY_ARRAY_SIZE_TYPE __array_offset = LY_ARRAY_SIZE(ARRAY_C); \
-        for (ITER = 0; ITER < LY_ARRAY_SIZE(ARRAY_P); ++ITER) { \
+        LY_ARRAY_CREATE_GOTO((CTX)->ctx, ARRAY_C, LY_ARRAY_COUNT(ARRAY_P), RET, GOTO); \
+        LY_ARRAY_COUNT_TYPE __array_offset = LY_ARRAY_COUNT(ARRAY_C); \
+        for (ITER = 0; ITER < LY_ARRAY_COUNT(ARRAY_P); ++ITER) { \
             LY_ARRAY_INCREMENT(ARRAY_C); \
             RET = FUNC(CTX, &(ARRAY_P)[ITER], &(ARRAY_C)[ITER + __array_offset]); \
             LY_CHECK_GOTO(RET != LY_SUCCESS, GOTO); \
@@ -64,9 +64,9 @@
 
 #define COMPILE_ARRAY1_GOTO(CTX, ARRAY_P, ARRAY_C, PARENT, ITER, FUNC, USES_STATUS, RET, GOTO) \
     if (ARRAY_P) { \
-        LY_ARRAY_CREATE_GOTO((CTX)->ctx, ARRAY_C, LY_ARRAY_SIZE(ARRAY_P), RET, GOTO); \
-        LY_ARRAY_SIZE_TYPE __array_offset = LY_ARRAY_SIZE(ARRAY_C); \
-        for (ITER = 0; ITER < LY_ARRAY_SIZE(ARRAY_P); ++ITER) { \
+        LY_ARRAY_CREATE_GOTO((CTX)->ctx, ARRAY_C, LY_ARRAY_COUNT(ARRAY_P), RET, GOTO); \
+        LY_ARRAY_COUNT_TYPE __array_offset = LY_ARRAY_COUNT(ARRAY_C); \
+        for (ITER = 0; ITER < LY_ARRAY_COUNT(ARRAY_P); ++ITER) { \
             LY_ARRAY_INCREMENT(ARRAY_C); \
             RET = FUNC(CTX, &(ARRAY_P)[ITER], PARENT, &(ARRAY_C)[ITER + __array_offset], USES_STATUS); \
             LY_CHECK_GOTO(RET != LY_SUCCESS, GOTO); \
@@ -75,8 +75,8 @@
 
 #define COMPILE_EXTS_GOTO(CTX, EXTS_P, EXT_C, PARENT, PARENT_TYPE, RET, GOTO) \
     if (EXTS_P) { \
-        LY_ARRAY_CREATE_GOTO((CTX)->ctx, EXT_C, LY_ARRAY_SIZE(EXTS_P), RET, GOTO); \
-        for (LY_ARRAY_SIZE_TYPE __exts_iter = 0, __array_offset = LY_ARRAY_SIZE(EXT_C); __exts_iter < LY_ARRAY_SIZE(EXTS_P); ++__exts_iter) { \
+        LY_ARRAY_CREATE_GOTO((CTX)->ctx, EXT_C, LY_ARRAY_COUNT(EXTS_P), RET, GOTO); \
+        for (LY_ARRAY_COUNT_TYPE __exts_iter = 0, __array_offset = LY_ARRAY_COUNT(EXT_C); __exts_iter < LY_ARRAY_COUNT(EXTS_P); ++__exts_iter) { \
             LY_ARRAY_INCREMENT(EXT_C); \
             RET = lys_compile_ext(CTX, &(EXTS_P)[__exts_iter], &(EXT_C)[__exts_iter + __array_offset], PARENT, PARENT_TYPE, NULL); \
             LY_CHECK_GOTO(RET != LY_SUCCESS, GOTO); \
@@ -85,9 +85,9 @@
 
 #define COMPILE_ARRAY_UNIQUE_GOTO(CTX, ARRAY_P, ARRAY_C, ITER, FUNC, RET, GOTO) \
     if (ARRAY_P) { \
-        LY_ARRAY_CREATE_GOTO((CTX)->ctx, ARRAY_C, LY_ARRAY_SIZE(ARRAY_P), RET, GOTO); \
-        LY_ARRAY_SIZE_TYPE __array_offset = LY_ARRAY_SIZE(ARRAY_C); \
-        for (ITER = 0; ITER < LY_ARRAY_SIZE(ARRAY_P); ++ITER) { \
+        LY_ARRAY_CREATE_GOTO((CTX)->ctx, ARRAY_C, LY_ARRAY_COUNT(ARRAY_P), RET, GOTO); \
+        LY_ARRAY_COUNT_TYPE __array_offset = LY_ARRAY_COUNT(ARRAY_C); \
+        for (ITER = 0; ITER < LY_ARRAY_COUNT(ARRAY_P); ++ITER) { \
             LY_ARRAY_INCREMENT(ARRAY_C); \
             RET = FUNC(CTX, &(ARRAY_P)[ITER], ARRAY_C, &(ARRAY_C)[ITER + __array_offset]); \
             LY_CHECK_GOTO(RET != LY_SUCCESS, GOTO); \
@@ -105,7 +105,7 @@
 #define COMPILE_MEMBER_ARRAY_GOTO(CTX, MEMBER_P, ARRAY_C, FUNC, RET, GOTO) \
     if (MEMBER_P) { \
         LY_ARRAY_CREATE_GOTO((CTX)->ctx, ARRAY_C, 1, RET, GOTO); \
-        LY_ARRAY_SIZE_TYPE __array_offset = LY_ARRAY_SIZE(ARRAY_C); \
+        LY_ARRAY_COUNT_TYPE __array_offset = LY_ARRAY_COUNT(ARRAY_C); \
         LY_ARRAY_INCREMENT(ARRAY_C); \
         RET = FUNC(CTX, MEMBER_P, &(ARRAY_C)[__array_offset]); \
         LY_CHECK_GOTO(RET != LY_SUCCESS, GOTO); \
@@ -113,7 +113,7 @@
 
 #define COMPILE_CHECK_UNIQUENESS_ARRAY(CTX, ARRAY, MEMBER, EXCL, STMT, IDENT) \
     if (ARRAY) { \
-        for (LY_ARRAY_SIZE_TYPE u__ = 0; u__ < LY_ARRAY_SIZE(ARRAY); ++u__) { \
+        for (LY_ARRAY_COUNT_TYPE u__ = 0; u__ < LY_ARRAY_COUNT(ARRAY); ++u__) { \
             if (&(ARRAY)[u__] != EXCL && (void*)((ARRAY)[u__].MEMBER) == (void*)(IDENT)) { \
                 LOGVAL((CTX)->ctx, LY_VLOG_STR, (CTX)->path, LY_VCODE_DUPIDENT, IDENT, STMT); \
                 return LY_EVALID; \
@@ -123,7 +123,7 @@
 
 #define COMPILE_CHECK_UNIQUENESS_PARRAY(CTX, ARRAY, MEMBER, EXCL, STMT, IDENT) \
     if (ARRAY) { \
-        for (LY_ARRAY_SIZE_TYPE u__ = 0; u__ < LY_ARRAY_SIZE(ARRAY); ++u__) { \
+        for (LY_ARRAY_COUNT_TYPE u__ = 0; u__ < LY_ARRAY_COUNT(ARRAY); ++u__) { \
             if (&(ARRAY)[u__] != EXCL && (void*)((ARRAY)[u__]->MEMBER) == (void*)(IDENT)) { \
                 LOGVAL((CTX)->ctx, LY_VLOG_STR, (CTX)->path, LY_VCODE_DUPIDENT, IDENT, STMT); \
                 return LY_EVALID; \
@@ -278,11 +278,11 @@
 lysc_patterns_dup(struct ly_ctx *ctx, struct lysc_pattern **orig)
 {
     struct lysc_pattern **dup = NULL;
-    LY_ARRAY_SIZE_TYPE u;
+    LY_ARRAY_COUNT_TYPE u;
 
     assert(orig);
 
-    LY_ARRAY_CREATE_RET(ctx, dup, LY_ARRAY_SIZE(orig), NULL);
+    LY_ARRAY_CREATE_RET(ctx, dup, LY_ARRAY_COUNT(orig), NULL);
     LY_ARRAY_FOR(orig, u) {
         dup[u] = lysc_pattern_dup(orig[u]);
         LY_ARRAY_INCREMENT(dup);
@@ -309,9 +309,9 @@
     dup = calloc(1, sizeof *dup);
     LY_CHECK_ERR_RET(!dup, LOGMEM(ctx), NULL);
     if (orig->parts) {
-        LY_ARRAY_CREATE_GOTO(ctx, dup->parts, LY_ARRAY_SIZE(orig->parts), ret, cleanup);
-        LY_ARRAY_SIZE(dup->parts) = LY_ARRAY_SIZE(orig->parts);
-        memcpy(dup->parts, orig->parts, LY_ARRAY_SIZE(dup->parts) * sizeof *dup->parts);
+        LY_ARRAY_CREATE_GOTO(ctx, dup->parts, LY_ARRAY_COUNT(orig->parts), ret, cleanup);
+        LY_ARRAY_COUNT(dup->parts) = LY_ARRAY_COUNT(orig->parts);
+        memcpy(dup->parts, orig->parts, LY_ARRAY_COUNT(dup->parts) * sizeof *dup->parts);
     }
     DUP_STRING(ctx, orig->eapptag, dup->eapptag);
     DUP_STRING(ctx, orig->emsg, dup->emsg);
@@ -421,7 +421,7 @@
 lys_feature_find(struct lys_module *mod, const char *name, size_t len)
 {
     size_t i;
-    LY_ARRAY_SIZE_TYPE u;
+    LY_ARRAY_COUNT_TYPE u;
     struct lysc_feature *f, *flist;
 
     for (i = 0; i < len; ++i) {
@@ -502,7 +502,7 @@
     LY_ERR ret = LY_EVALID;
     const char *name;
     size_t u;
-    LY_ARRAY_SIZE_TYPE v;
+    LY_ARRAY_COUNT_TYPE v;
     const char *prefixed_name = NULL;
 
     DUP_STRING(ctx->ctx, ext_p->argument, ext->argument);
@@ -952,7 +952,7 @@
 lys_identity_precompile(struct lysc_ctx *ctx_sc, struct ly_ctx *ctx, struct lys_module *module,
                         struct lysp_ident *identities_p, struct lysc_ident **identities)
 {
-    LY_ARRAY_SIZE_TYPE offset = 0, u, v;
+    LY_ARRAY_COUNT_TYPE offset = 0, u, v;
     struct lysc_ctx context = {0};
     LY_ERR ret = LY_SUCCESS;
 
@@ -970,11 +970,11 @@
         return LY_SUCCESS;
     }
     if (*identities) {
-        offset = LY_ARRAY_SIZE(*identities);
+        offset = LY_ARRAY_COUNT(*identities);
     }
 
     lysc_update_path(ctx_sc, NULL, "{identity}");
-    LY_ARRAY_CREATE_RET(ctx_sc->ctx, *identities, LY_ARRAY_SIZE(identities_p), LY_EMEM);
+    LY_ARRAY_CREATE_RET(ctx_sc->ctx, *identities, LY_ARRAY_COUNT(identities_p), LY_EMEM);
     LY_ARRAY_FOR(identities_p, u) {
         lysc_update_path(ctx_sc, NULL, identities_p[u].name);
 
@@ -1013,7 +1013,7 @@
 lys_compile_identity_circular_check(struct lysc_ctx *ctx, struct lysc_ident *ident, struct lysc_ident **derived)
 {
     LY_ERR ret = LY_EVALID;
-    LY_ARRAY_SIZE_TYPE u, v;
+    LY_ARRAY_COUNT_TYPE u, v;
     struct ly_set recursion = {0};
     struct lysc_ident *drv;
 
@@ -1021,7 +1021,7 @@
         return LY_SUCCESS;
     }
 
-    for (u = 0; u < LY_ARRAY_SIZE(derived); ++u) {
+    for (u = 0; u < LY_ARRAY_COUNT(derived); ++u) {
         if (ident == derived[u]) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                    "Identity \"%s\" is indirectly derived from itself.", ident->name);
@@ -1035,7 +1035,7 @@
         if (!drv->derived) {
             continue;
         }
-        for (u = 0; u < LY_ARRAY_SIZE(drv->derived); ++u) {
+        for (u = 0; u < LY_ARRAY_COUNT(drv->derived); ++u) {
             if (ident == drv->derived[u]) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                        "Identity \"%s\" is indirectly derived from itself.", ident->name);
@@ -1068,14 +1068,14 @@
 lys_compile_identity_bases(struct lysc_ctx *ctx, struct lys_module *context_module, const char **bases_p,
                            struct lysc_ident *ident, struct lysc_ident ***bases)
 {
-    LY_ARRAY_SIZE_TYPE u, v;
+    LY_ARRAY_COUNT_TYPE u, v;
     const char *s, *name;
     struct lys_module *mod;
     struct lysc_ident **idref, *identities;
 
     assert(ident || bases);
 
-    if (LY_ARRAY_SIZE(bases_p) > 1 && ctx->mod_def->version < 2) {
+    if (LY_ARRAY_COUNT(bases_p) > 1 && ctx->mod_def->version < 2) {
         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                "Multiple bases in %s are allowed only in YANG 1.1 modules.", ident ? "identity" : "identityref type");
         return LY_EVALID;
@@ -1152,10 +1152,10 @@
 static LY_ERR
 lys_compile_identities_derived(struct lysc_ctx *ctx, struct lysp_ident *idents_p, struct lysc_ident *idents)
 {
-    LY_ARRAY_SIZE_TYPE u;
+    LY_ARRAY_COUNT_TYPE u;
 
     lysc_update_path(ctx, NULL, "{identity}");
-    for (u = 0; u < LY_ARRAY_SIZE(idents_p); ++u) {
+    for (u = 0; u < LY_ARRAY_COUNT(idents_p); ++u) {
         if (!idents_p[u].bases) {
             continue;
         }
@@ -1171,7 +1171,7 @@
 lys_feature_precompile(struct lysc_ctx *ctx_sc, struct ly_ctx *ctx, struct lys_module *module,
                        struct lysp_feature *features_p, struct lysc_feature **features)
 {
-    LY_ARRAY_SIZE_TYPE offset = 0, u;
+    LY_ARRAY_COUNT_TYPE offset = 0, u;
     struct lysc_ctx context = {0};
 
     assert(ctx_sc || ctx);
@@ -1188,11 +1188,11 @@
         return LY_SUCCESS;
     }
     if (*features) {
-        offset = LY_ARRAY_SIZE(*features);
+        offset = LY_ARRAY_COUNT(*features);
     }
 
     lysc_update_path(ctx_sc, NULL, "{feature}");
-    LY_ARRAY_CREATE_RET(ctx_sc->ctx, *features, LY_ARRAY_SIZE(features_p), LY_EMEM);
+    LY_ARRAY_CREATE_RET(ctx_sc->ctx, *features, LY_ARRAY_COUNT(features_p), LY_EMEM);
     LY_ARRAY_FOR(features_p, u) {
         lysc_update_path(ctx_sc, NULL, features_p[u].name);
 
@@ -1227,7 +1227,7 @@
 lys_compile_feature_circular_check(struct lysc_ctx *ctx, struct lysc_feature *feature, struct lysc_feature **depfeatures)
 {
     LY_ERR ret = LY_EVALID;
-    LY_ARRAY_SIZE_TYPE u, v;
+    LY_ARRAY_COUNT_TYPE u, v;
     struct ly_set recursion = {0};
     struct lysc_feature *drv;
 
@@ -1235,7 +1235,7 @@
         return LY_SUCCESS;
     }
 
-    for (u = 0; u < LY_ARRAY_SIZE(depfeatures); ++u) {
+    for (u = 0; u < LY_ARRAY_COUNT(depfeatures); ++u) {
         if (feature == depfeatures[u]) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                    "Feature \"%s\" is indirectly referenced from itself.", feature->name);
@@ -1249,7 +1249,7 @@
         if (!drv->depfeatures) {
             continue;
         }
-        for (u = 0; u < LY_ARRAY_SIZE(drv->depfeatures); ++u) {
+        for (u = 0; u < LY_ARRAY_COUNT(drv->depfeatures); ++u) {
             if (feature == drv->depfeatures[u]) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                        "Feature \"%s\" is indirectly referenced from itself.", feature->name);
@@ -1278,7 +1278,7 @@
 static LY_ERR
 lys_feature_precompile_finish(struct lysc_ctx *ctx, struct lysp_feature *feature_p, struct lysc_feature *features)
 {
-    LY_ARRAY_SIZE_TYPE u, v, x;
+    LY_ARRAY_COUNT_TYPE u, v, x;
     struct lysc_feature *feature, **df;
     LY_ERR ret = LY_SUCCESS;
 
@@ -1296,9 +1296,9 @@
         COMPILE_EXTS_GOTO(ctx, feature_p->exts, feature->exts, feature, LYEXT_PAR_FEATURE, ret, done);
         COMPILE_ARRAY_GOTO(ctx, feature_p->iffeatures, feature->iffeatures, u, lys_compile_iffeature, ret, done);
         if (feature->iffeatures) {
-            for (u = 0; u < LY_ARRAY_SIZE(feature->iffeatures); ++u) {
+            for (u = 0; u < LY_ARRAY_COUNT(feature->iffeatures); ++u) {
                 if (feature->iffeatures[u].features) {
-                    for (v = 0; v < LY_ARRAY_SIZE(feature->iffeatures[u].features); ++v) {
+                    for (v = 0; v < LY_ARRAY_COUNT(feature->iffeatures[u].features); ++v) {
                         /* check for circular dependency - direct reference first,... */
                         if (feature == feature->iffeatures[u].features[v]) {
                             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
@@ -1338,7 +1338,7 @@
 static void
 lys_feature_precompile_revert(struct lysc_ctx *ctx, struct lys_module *mod)
 {
-    LY_ARRAY_SIZE_TYPE u, v;
+    LY_ARRAY_COUNT_TYPE u, v;
 
     /* keep the dis_features list until the complete lys_module is freed */
     mod->dis_features = mod->compiled->features;
@@ -1494,7 +1494,7 @@
     }
     if (!valcopy && base_range) {
         if (max) {
-            part->max_64 = base_range->parts[LY_ARRAY_SIZE(base_range->parts) - 1].max_64;
+            part->max_64 = base_range->parts[LY_ARRAY_COUNT(base_range->parts) - 1].max_64;
         } else {
             part->min_64 = base_range->parts[0].min_64;
         }
@@ -1651,7 +1651,7 @@
     const char *expr;
     struct lysc_range_part *parts = NULL, *part;
     int range_expected = 0, uns;
-    LY_ARRAY_SIZE_TYPE parts_done = 0, u, v;
+    LY_ARRAY_COUNT_TYPE parts_done = 0, u, v;
 
     assert(range);
     assert(range_p);
@@ -1666,7 +1666,7 @@
                        "Invalid %s restriction - unexpected end of the expression after \"..\" (%s).",
                        length_restr ? "length" : "range", range_p->arg);
                 goto cleanup;
-            } else if (!parts || parts_done == LY_ARRAY_SIZE(parts)) {
+            } else if (!parts || parts_done == LY_ARRAY_COUNT(parts)) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                        "Invalid %s restriction - unexpected end of the expression (%s).",
                        length_restr ? "length" : "range", range_p->arg);
@@ -1701,7 +1701,7 @@
             while (isspace(*expr)) {
                 expr++;
             }
-            if (!parts || LY_ARRAY_SIZE(parts) == parts_done) {
+            if (!parts || LY_ARRAY_COUNT(parts) == parts_done) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                        "Invalid %s restriction - unexpected \"..\" without a lower bound.", length_restr ? "length" : "range");
                 goto cleanup;
@@ -1711,12 +1711,12 @@
         } else if (isdigit(*expr) || (*expr == '-') || (*expr == '+')) {
             /* number */
             if (range_expected) {
-                part = &parts[LY_ARRAY_SIZE(parts) - 1];
+                part = &parts[LY_ARRAY_COUNT(parts) - 1];
                 LY_CHECK_GOTO(range_part_minmax(ctx, part, 1, part->min_64, basetype, 0, length_restr, frdigits, NULL, &expr), cleanup);
                 range_expected = 0;
             } else {
                 LY_ARRAY_NEW_GOTO(ctx->ctx, parts, part, ret, cleanup);
-                LY_CHECK_GOTO(range_part_minmax(ctx, part, 0, parts_done ? parts[LY_ARRAY_SIZE(parts) - 2].max_64 : 0,
+                LY_CHECK_GOTO(range_part_minmax(ctx, part, 0, parts_done ? parts[LY_ARRAY_COUNT(parts) - 2].max_64 : 0,
                                                 basetype, parts_done ? 0 : 1, length_restr, frdigits, NULL, &expr), cleanup);
                 part->max_64 = part->min_64;
             }
@@ -1733,12 +1733,12 @@
                 goto cleanup;
             }
             if (range_expected) {
-                part = &parts[LY_ARRAY_SIZE(parts) - 1];
+                part = &parts[LY_ARRAY_COUNT(parts) - 1];
                 LY_CHECK_GOTO(range_part_minmax(ctx, part, 1, part->min_64, basetype, 0, length_restr, frdigits, base_range, NULL), cleanup);
                 range_expected = 0;
             } else {
                 LY_ARRAY_NEW_GOTO(ctx->ctx, parts, part, ret, cleanup);
-                LY_CHECK_GOTO(range_part_minmax(ctx, part, 1, parts_done ? parts[LY_ARRAY_SIZE(parts) - 2].max_64 : 0,
+                LY_CHECK_GOTO(range_part_minmax(ctx, part, 1, parts_done ? parts[LY_ARRAY_COUNT(parts) - 2].max_64 : 0,
                                                 basetype, parts_done ? 0 : 1, length_restr, frdigits, base_range, NULL), cleanup);
                 part->min_64 = part->max_64;
             }
@@ -1772,7 +1772,7 @@
             ret = LY_EINT;
             goto cleanup;
         }
-        for (u = v = 0; u < parts_done && v < LY_ARRAY_SIZE(base_range->parts); ++u) {
+        for (u = v = 0; u < parts_done && v < LY_ARRAY_COUNT(base_range->parts); ++u) {
             if ((uns && parts[u].min_u64 < base_range->parts[v].min_u64) || (!uns && parts[u].min_64 < base_range->parts[v].min_64)) {
                 goto baseerror;
             }
@@ -2119,7 +2119,7 @@
                           struct lysc_pattern **base_patterns, struct lysc_pattern ***patterns)
 {
     struct lysc_pattern **pattern;
-    LY_ARRAY_SIZE_TYPE u;
+    LY_ARRAY_COUNT_TYPE u;
     LY_ERR ret = LY_SUCCESS;
 
     /* first, copy the patterns from the base type */
@@ -2198,7 +2198,7 @@
                        struct lysc_type_bitenum_item *base_enums, struct lysc_type_bitenum_item **enums)
 {
     LY_ERR ret = LY_SUCCESS;
-    LY_ARRAY_SIZE_TYPE u, v, match = 0;
+    LY_ARRAY_COUNT_TYPE u, v, match = 0;
     int32_t value = 0;
     uint32_t position = 0;
     struct lysc_type_bitenum_item *e, storage;
@@ -2222,7 +2222,7 @@
                     break;
                 }
             }
-            if (v == LY_ARRAY_SIZE(base_enums)) {
+            if (v == LY_ARRAY_COUNT(base_enums)) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                        "Invalid %s - derived type adds new item \"%s\".",
                        basetype == LY_TYPE_ENUM ? "enumeration" : "bits", e->name);
@@ -2239,7 +2239,7 @@
                     value = e->value + 1;
                 }
                 /* check collision with other values */
-                for (v = 0; v < LY_ARRAY_SIZE(*enums) - 1; ++v) {
+                for (v = 0; v < LY_ARRAY_COUNT(*enums) - 1; ++v) {
                     if (e->value == (*enums)[v].value) {
                         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                                "Invalid enumeration - value %d collide in items \"%s\" and \"%s\".",
@@ -2271,7 +2271,7 @@
                     position = (uint32_t)e->value + 1;
                 }
                 /* check collision with other values */
-                for (v = 0; v < LY_ARRAY_SIZE(*enums) - 1; ++v) {
+                for (v = 0; v < LY_ARRAY_COUNT(*enums) - 1; ++v) {
                     if (e->value == (*enums)[v].value) {
                         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                                "Invalid bits - position %u collide in items \"%s\" and \"%s\".",
@@ -2424,7 +2424,7 @@
 {
     LY_ERR ret = LY_EVALID;
     const struct lysc_node *iter;
-    LY_ARRAY_SIZE_TYPE u, v, count;
+    LY_ARRAY_COUNT_TYPE u, v, count;
     struct ly_set features = {0};
 
     for (iter = refnode; iter; iter = iter->parent) {
@@ -2781,18 +2781,18 @@
                 return LY_EVALID;
             }
             /* compile the type */
-            LY_ARRAY_CREATE_RET(ctx->ctx, un->types, LY_ARRAY_SIZE(type_p->types), LY_EVALID);
-            for (LY_ARRAY_SIZE_TYPE u = 0, additional = 0; u < LY_ARRAY_SIZE(type_p->types); ++u) {
+            LY_ARRAY_CREATE_RET(ctx->ctx, un->types, LY_ARRAY_COUNT(type_p->types), LY_EVALID);
+            for (LY_ARRAY_COUNT_TYPE u = 0, additional = 0; u < LY_ARRAY_COUNT(type_p->types); ++u) {
                 LY_CHECK_RET(lys_compile_type(ctx, context_node_p, context_flags, context_mod, context_name,
                                               &type_p->types[u], &un->types[u + additional], NULL));
                 if (un->types[u + additional]->basetype == LY_TYPE_UNION) {
                     /* add space for additional types from the union subtype */
                     un_aux = (struct lysc_type_union *)un->types[u + additional];
-                    LY_ARRAY_RESIZE_ERR_RET(ctx->ctx, un->types, (*((uint64_t*)(type_p->types) - 1)) + additional + LY_ARRAY_SIZE(un_aux->types) - 1,
+                    LY_ARRAY_RESIZE_ERR_RET(ctx->ctx, un->types, (*((uint64_t*)(type_p->types) - 1)) + additional + LY_ARRAY_COUNT(un_aux->types) - 1,
                                             lysc_type_free(ctx->ctx, (struct lysc_type*)un_aux), LY_EMEM);
 
                     /* copy subtypes of the subtype union */
-                    for (LY_ARRAY_SIZE_TYPE v = 0; v < LY_ARRAY_SIZE(un_aux->types); ++v) {
+                    for (LY_ARRAY_COUNT_TYPE v = 0; v < LY_ARRAY_COUNT(un_aux->types); ++v) {
                         if (un_aux->types[v]->basetype == LY_TYPE_LEAFREF) {
                             /* duplicate the whole structure because of the instance-specific path resolving for realtype */
                             un->types[u + additional] = calloc(1, sizeof(struct lysc_type_leafref));
@@ -3179,7 +3179,7 @@
                           const struct lysc_notif *notifs, const char *name, void *exclude)
 {
     const struct lysc_node *iter;
-    LY_ARRAY_SIZE_TYPE u;
+    LY_ARRAY_COUNT_TYPE u;
 
     LY_LIST_FOR(children, iter) {
         if (iter != exclude && iter->module == ctx->mod && !strcmp(name, iter->name)) {
@@ -3434,7 +3434,7 @@
         /* store to validate the path in the current context at the end of schema compiling when all the nodes are present */
         ly_set_add(&ctx->leafrefs, leaf, 0);
     } else if (leaf->type->basetype == LY_TYPE_UNION) {
-        LY_ARRAY_SIZE_TYPE u;
+        LY_ARRAY_COUNT_TYPE u;
         LY_ARRAY_FOR(((struct lysc_type_union*)leaf->type)->types, u) {
             if (((struct lysc_type_union*)leaf->type)->types[u]->basetype == LY_TYPE_LEAFREF) {
                 /* store to validate the path in the current context at the end of schema compiling when all the nodes are present */
@@ -3530,7 +3530,7 @@
 {
     struct lysp_node_leaflist *llist_p = (struct lysp_node_leaflist*)node_p;
     struct lysc_node_leaflist *llist = (struct lysc_node_leaflist*)node;
-    LY_ARRAY_SIZE_TYPE u, v;
+    LY_ARRAY_COUNT_TYPE u, v;
     LY_ERR ret = LY_SUCCESS;
 
     COMPILE_ARRAY_GOTO(ctx, llist_p->musts, llist->musts, u, lys_compile_must, ret, done);
@@ -3556,8 +3556,8 @@
 
     if (llist_p->dflts) {
         llist->dflts = NULL; /* reset the temporary llist_p->dflts */
-        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts_mods, LY_ARRAY_SIZE(llist_p->dflts), ret, done);
-        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts, LY_ARRAY_SIZE(llist_p->dflts), ret, done);
+        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts_mods, LY_ARRAY_COUNT(llist_p->dflts), ret, done);
+        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts, LY_ARRAY_COUNT(llist_p->dflts), ret, done);
         LY_ARRAY_FOR(llist_p->dflts, u) {
             struct ly_err_item *err = NULL;
             LY_ARRAY_INCREMENT(llist->dflts_mods);
@@ -3586,10 +3586,10 @@
         }
         llist->flags |= LYS_SET_DFLT;
     }
-    if ((llist->flags & LYS_CONFIG_W) && llist->dflts && LY_ARRAY_SIZE(llist->dflts)) {
+    if ((llist->flags & LYS_CONFIG_W) && llist->dflts && LY_ARRAY_COUNT(llist->dflts)) {
         /* configuration data values must be unique - so check the default values */
         LY_ARRAY_FOR(llist->dflts, u) {
-            for (v = u + 1; v < LY_ARRAY_SIZE(llist->dflts); ++v) {
+            for (v = u + 1; v < LY_ARRAY_COUNT(llist->dflts); ++v) {
                 if (!llist->type->plugin->compare(llist->dflts[u], llist->dflts[v])) {
                     int dynamic = 0;
                     const char *val = llist->type->plugin->print(llist->dflts[v], LYD_XML, lys_get_prefix, llist->dflts_mods[v], &dynamic);
@@ -3632,11 +3632,11 @@
     struct lysc_node *parent;
     const char *keystr, *delim;
     size_t len;
-    LY_ARRAY_SIZE_TYPE v;
+    LY_ARRAY_COUNT_TYPE v;
     int config;
     uint16_t flags;
 
-    for (v = 0; v < LY_ARRAY_SIZE(uniques); ++v) {
+    for (v = 0; v < LY_ARRAY_COUNT(uniques); ++v) {
         config = -1;
         LY_ARRAY_NEW_RET(ctx->ctx, list->uniques, unique, LY_EMEM);
         keystr = uniques[v];
@@ -4286,7 +4286,7 @@
 static void
 lys_compile_augment_sort_(struct lysp_augment *aug_p, struct lysp_augment **result)
 {
-    LY_ARRAY_SIZE_TYPE v;
+    LY_ARRAY_COUNT_TYPE v;
     size_t len;
 
     len = strlen(aug_p->nodeid);
@@ -4294,9 +4294,9 @@
         if (strlen(result[v]->nodeid) <= len) {
             continue;
         }
-        if (v < LY_ARRAY_SIZE(result)) {
+        if (v < LY_ARRAY_COUNT(result)) {
             /* move the rest of array */
-            memmove(&result[v + 1], &result[v], (LY_ARRAY_SIZE(result) - v) * sizeof *result);
+            memmove(&result[v + 1], &result[v], (LY_ARRAY_COUNT(result) - v) * sizeof *result);
             break;
         }
     }
@@ -4321,17 +4321,17 @@
 lys_compile_augment_sort(struct lysc_ctx *ctx, struct lysp_augment *aug_p, struct lysp_include *inc_p, struct lysp_augment ***augments)
 {
     struct lysp_augment **result = NULL;
-    LY_ARRAY_SIZE_TYPE u, v, count = 0;
+    LY_ARRAY_COUNT_TYPE u, v, count = 0;
 
     assert(augments);
 
     /* get count of the augments in module and all its submodules */
     if (aug_p) {
-        count += LY_ARRAY_SIZE(aug_p);
+        count += LY_ARRAY_COUNT(aug_p);
     }
     LY_ARRAY_FOR(inc_p, u) {
         if (inc_p[u].submodule->augments) {
-            count += LY_ARRAY_SIZE(inc_p[u].submodule->augments);
+            count += LY_ARRAY_COUNT(inc_p[u].submodule->augments);
         }
     }
 
@@ -4626,7 +4626,7 @@
          .prev = (struct lysc_node*)&context_node_fake,
          .actions = NULL, .notifs = NULL};
     struct lysp_grp *grp = NULL;
-    LY_ARRAY_SIZE_TYPE u, v;
+    LY_ARRAY_COUNT_TYPE u, v;
     uint32_t grp_stack_count;
     int found;
     const char *id, *name, *prefix;
@@ -4639,7 +4639,7 @@
     struct ly_set refined = {0};
     struct lysc_when **when, *when_shared;
     struct lysp_augment **augments = NULL;
-    LY_ARRAY_SIZE_TYPE actions_index = 0, notifs_index = 0;
+    LY_ARRAY_COUNT_TYPE actions_index = 0, notifs_index = 0;
     struct lysc_notif **notifs = NULL;
     struct lysc_action **actions = NULL;
 
@@ -4673,7 +4673,7 @@
         /* search in top-level groupings of the main module ... */
         grp = mod->parsed->groupings;
         if (grp) {
-            for (u = 0; !found && u < LY_ARRAY_SIZE(grp); ++u) {
+            for (u = 0; !found && u < LY_ARRAY_COUNT(grp); ++u) {
                 if (!strcmp(grp[u].name, name)) {
                     grp = &grp[u];
                     found = 1;
@@ -4682,10 +4682,10 @@
         }
         if (!found && mod->parsed->includes) {
             /* ... and all the submodules */
-            for (u = 0; !found && u < LY_ARRAY_SIZE(mod->parsed->includes); ++u) {
+            for (u = 0; !found && u < LY_ARRAY_COUNT(mod->parsed->includes); ++u) {
                 grp = mod->parsed->includes[u].submodule->groupings;
                 if (grp) {
-                    for (v = 0; !found && v < LY_ARRAY_SIZE(grp); ++v) {
+                    for (v = 0; !found && v < LY_ARRAY_COUNT(grp); ++v) {
                         if (!strcmp(grp[v].name, name)) {
                             grp = &grp[v];
                             found = 1;
@@ -4777,26 +4777,26 @@
     /* compile actions */
     actions = parent ? lysc_node_actions_p(parent) : &ctx->mod->compiled->rpcs;
     if (actions) {
-        actions_index = *actions ? LY_ARRAY_SIZE(*actions) : 0;
+        actions_index = *actions ? LY_ARRAY_COUNT(*actions) : 0;
         COMPILE_ARRAY1_GOTO(ctx, grp->actions, *actions, parent, u, lys_compile_action, 0, ret, cleanup);
         if (*actions && (uses_p->augments || uses_p->refines)) {
             /* but for augment and refine, we need to separate the compiled grouping's actions to avoid modification of others */
-            LY_ARRAY_CREATE_GOTO(ctx->ctx, context_node_fake.actions, LY_ARRAY_SIZE(*actions) - actions_index, ret, cleanup);
-            LY_ARRAY_SIZE(context_node_fake.actions) = LY_ARRAY_SIZE(*actions) - actions_index;
-            memcpy(context_node_fake.actions, &(*actions)[actions_index], LY_ARRAY_SIZE(context_node_fake.actions) * sizeof **actions);
+            LY_ARRAY_CREATE_GOTO(ctx->ctx, context_node_fake.actions, LY_ARRAY_COUNT(*actions) - actions_index, ret, cleanup);
+            LY_ARRAY_COUNT(context_node_fake.actions) = LY_ARRAY_COUNT(*actions) - actions_index;
+            memcpy(context_node_fake.actions, &(*actions)[actions_index], LY_ARRAY_COUNT(context_node_fake.actions) * sizeof **actions);
         }
     }
 
     /* compile notifications */
     notifs = parent ? lysc_node_notifs_p(parent) : &ctx->mod->compiled->notifs;
     if (notifs) {
-        notifs_index = *notifs ? LY_ARRAY_SIZE(*notifs) : 0;
+        notifs_index = *notifs ? LY_ARRAY_COUNT(*notifs) : 0;
         COMPILE_ARRAY1_GOTO(ctx, grp->notifs, *notifs, parent, u, lys_compile_notif, 0, ret, cleanup);
         if (*notifs && (uses_p->augments || uses_p->refines)) {
             /* but for augment and refine, we need to separate the compiled grouping's notification to avoid modification of others */
-            LY_ARRAY_CREATE_GOTO(ctx->ctx, context_node_fake.notifs, LY_ARRAY_SIZE(*notifs) - notifs_index, ret, cleanup);
-            LY_ARRAY_SIZE(context_node_fake.notifs) = LY_ARRAY_SIZE(*notifs) - notifs_index;
-            memcpy(context_node_fake.notifs, &(*notifs)[notifs_index], LY_ARRAY_SIZE(context_node_fake.notifs) * sizeof **notifs);
+            LY_ARRAY_CREATE_GOTO(ctx->ctx, context_node_fake.notifs, LY_ARRAY_COUNT(*notifs) - notifs_index, ret, cleanup);
+            LY_ARRAY_COUNT(context_node_fake.notifs) = LY_ARRAY_COUNT(*notifs) - notifs_index;
+            memcpy(context_node_fake.notifs, &(*notifs)[notifs_index], LY_ARRAY_COUNT(context_node_fake.notifs) * sizeof **notifs);
         }
     }
 
@@ -4822,10 +4822,10 @@
 
         /* default value */
         if (rfn->dflts) {
-            if ((node->nodetype != LYS_LEAFLIST) && LY_ARRAY_SIZE(rfn->dflts) > 1) {
+            if ((node->nodetype != LYS_LEAFLIST) && LY_ARRAY_COUNT(rfn->dflts) > 1) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
-                       "Invalid refine of default - %s cannot hold %"LY_PRI_ARRAY_SIZE_TYPE" default values.",
-                       lys_nodetype2str(node->nodetype), LY_ARRAY_SIZE(rfn->dflts));
+                       "Invalid refine of default - %s cannot hold %"LY_PRI_ARRAY_COUNT_TYPE" default values.",
+                       lys_nodetype2str(node->nodetype), LY_ARRAY_COUNT(rfn->dflts));
                 goto cleanup;
             }
             if (!(node->nodetype & (LYS_LEAF | LYS_LEAFLIST | LYS_CHOICE))) {
@@ -4890,8 +4890,8 @@
                 llist->dflts_mods = NULL;
 
                 /* create the new set of the default values */
-                LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts_mods, LY_ARRAY_SIZE(rfn->dflts), ret, cleanup);
-                LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts, LY_ARRAY_SIZE(rfn->dflts), ret, cleanup);
+                LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts_mods, LY_ARRAY_COUNT(rfn->dflts), ret, cleanup);
+                LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts, LY_ARRAY_COUNT(rfn->dflts), ret, cleanup);
                 LY_ARRAY_FOR(rfn->dflts, u) {
                     struct ly_err_item *err = NULL;
                     LY_ARRAY_INCREMENT(llist->dflts_mods);
@@ -5091,11 +5091,11 @@
     if (uses_p->augments || uses_p->refines) {
         /* return back actions and notifications in case they were separated for augment/refine processing */
         if (context_node_fake.actions) {
-            memcpy(&(*actions)[actions_index], context_node_fake.actions, LY_ARRAY_SIZE(context_node_fake.actions) * sizeof **actions);
+            memcpy(&(*actions)[actions_index], context_node_fake.actions, LY_ARRAY_COUNT(context_node_fake.actions) * sizeof **actions);
             LY_ARRAY_FREE(context_node_fake.actions);
         }
         if (context_node_fake.notifs) {
-            memcpy(&(*notifs)[notifs_index], context_node_fake.notifs, LY_ARRAY_SIZE(context_node_fake.notifs) * sizeof **notifs);
+            memcpy(&(*notifs)[notifs_index], context_node_fake.notifs, LY_ARRAY_COUNT(context_node_fake.notifs) * sizeof **notifs);
             LY_ARRAY_FREE(context_node_fake.notifs);
         }
     }
@@ -5530,7 +5530,7 @@
     struct lysp_deviate_add *d_add;
     struct lysp_deviate_del *d_del;
     struct lysp_deviate_rpl *d_rpl;
-    LY_ARRAY_SIZE_TYPE u, v, x, y, z;
+    LY_ARRAY_COUNT_TYPE u, v, x, y, z;
     struct lysc_deviation {
         const char *nodeid;
         struct lysc_node *target;      /* target node of the deviation */
@@ -5612,9 +5612,9 @@
     }
 
 #define DEV_CHECK_CARDINALITY(ARRAY, MAX, PROPERTY) \
-    if (LY_ARRAY_SIZE(ARRAY) > MAX) { \
-        LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS, "Invalid deviation of %s with too many (%"LY_PRI_ARRAY_SIZE_TYPE") %s properties.", \
-               lys_nodetype2str(devs[u]->target->nodetype), LY_ARRAY_SIZE(ARRAY), PROPERTY); \
+    if (LY_ARRAY_COUNT(ARRAY) > MAX) { \
+        LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS, "Invalid deviation of %s with too many (%"LY_PRI_ARRAY_COUNT_TYPE") %s properties.", \
+               lys_nodetype2str(devs[u]->target->nodetype), LY_ARRAY_COUNT(ARRAY), PROPERTY); \
         goto cleanup; \
     }
 
@@ -5665,7 +5665,7 @@
         LY_ARRAY_FOR(((TYPE)devs[u]->target)->ARRAY_TRG, y) { \
             if (!strcmp(((TYPE)devs[u]->target)->ARRAY_TRG[y]VALMEMBER_CMP, d_del->ARRAY_DEV[x]VALMEMBER)) { break; } \
         } \
-        if (y == LY_ARRAY_SIZE(((TYPE)devs[u]->target)->ARRAY_TRG)) { \
+        if (y == LY_ARRAY_COUNT(((TYPE)devs[u]->target)->ARRAY_TRG)) { \
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE, \
                    "Invalid deviation deleting \"%s\" property \"%s\" which does not match any of the target's property values.", \
                    PROPERTY, d_del->ARRAY_DEV[x]VALMEMBER); \
@@ -5675,9 +5675,9 @@
         DELFUNC(ctx->ctx, DELFUNC_DEREF((TYPE)devs[u]->target)->ARRAY_TRG[y]); \
         memmove(&((TYPE)devs[u]->target)->ARRAY_TRG[y], \
                 &((TYPE)devs[u]->target)->ARRAY_TRG[y + 1], \
-                (LY_ARRAY_SIZE(((TYPE)devs[u]->target)->ARRAY_TRG) - y) * (sizeof *((TYPE)devs[u]->target)->ARRAY_TRG)); \
+                (LY_ARRAY_COUNT(((TYPE)devs[u]->target)->ARRAY_TRG) - y) * (sizeof *((TYPE)devs[u]->target)->ARRAY_TRG)); \
     } \
-    if (!LY_ARRAY_SIZE(((TYPE)devs[u]->target)->ARRAY_TRG)) { \
+    if (!LY_ARRAY_COUNT(((TYPE)devs[u]->target)->ARRAY_TRG)) { \
         LY_ARRAY_FREE(((TYPE)devs[u]->target)->ARRAY_TRG); \
         ((TYPE)devs[u]->target)->ARRAY_TRG = NULL; \
     }
@@ -5704,9 +5704,9 @@
 
         /* not-supported */
         if (devs[u]->not_supported) {
-            if (LY_ARRAY_SIZE(devs[u]->deviates) > 1) {
-                LOGWRN(ctx->ctx, "Useless multiple (%"LY_PRI_ARRAY_SIZE_TYPE") deviates on node \"%s\" since the node is not-supported.",
-                       LY_ARRAY_SIZE(devs[u]->deviates), devs[u]->nodeid);
+            if (LY_ARRAY_COUNT(devs[u]->deviates) > 1) {
+                LOGWRN(ctx->ctx, "Useless multiple (%"LY_PRI_ARRAY_COUNT_TYPE") deviates on node \"%s\" since the node is not-supported.",
+                       LY_ARRAY_COUNT(devs[u]->deviates), devs[u]->nodeid);
             }
 
 #define REMOVE_NONDATA(ARRAY, TYPE, GETFUNC, FREEFUNC) \
@@ -5718,9 +5718,9 @@
     LY_ARRAY_FOR(ARRAY, x) { \
         if (&ARRAY[x] == (TYPE*)devs[u]->target) { break; } \
     } \
-    if (x < LY_ARRAY_SIZE(ARRAY)) { \
+    if (x < LY_ARRAY_COUNT(ARRAY)) { \
         FREEFUNC(ctx->ctx, &ARRAY[x]); \
-        memmove(&ARRAY[x], &ARRAY[x + 1], (LY_ARRAY_SIZE(ARRAY) - (x + 1)) * sizeof *ARRAY); \
+        memmove(&ARRAY[x], &ARRAY[x + 1], (LY_ARRAY_COUNT(ARRAY) - (x + 1)) * sizeof *ARRAY); \
         LY_ARRAY_DECREMENT(ARRAY); \
     }
 
@@ -5851,10 +5851,10 @@
                             llist->dflts_mods = NULL;
                         }
                         /* add new default value(s) */
-                        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts_mods, LY_ARRAY_SIZE(d_add->dflts), ret, cleanup);
-                        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts, LY_ARRAY_SIZE(d_add->dflts), ret, cleanup);
-                        for (x = y = LY_ARRAY_SIZE(llist->dflts);
-                                x < LY_ARRAY_SIZE(d_add->dflts) + y; ++x) {
+                        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts_mods, LY_ARRAY_COUNT(d_add->dflts), ret, cleanup);
+                        LY_ARRAY_CREATE_GOTO(ctx->ctx, llist->dflts, LY_ARRAY_COUNT(d_add->dflts), ret, cleanup);
+                        for (x = y = LY_ARRAY_COUNT(llist->dflts);
+                                x < LY_ARRAY_COUNT(d_add->dflts) + y; ++x) {
                             LY_ARRAY_INCREMENT(llist->dflts_mods);
                             llist->dflts_mods[x] = ctx->mod_def;
                             LY_ARRAY_INCREMENT(llist->dflts);
@@ -6042,19 +6042,19 @@
                                 /* complete match - remove the unique */
                                 LY_ARRAY_DECREMENT(list->uniques);
                                 LY_ARRAY_FREE(list->uniques[z]);
-                                memmove(&list->uniques[z], &list->uniques[z + 1], (LY_ARRAY_SIZE(list->uniques) - z) * (sizeof *list->uniques));
+                                memmove(&list->uniques[z], &list->uniques[z + 1], (LY_ARRAY_COUNT(list->uniques) - z) * (sizeof *list->uniques));
                                 --z;
                                 break;
                             }
                         }
-                        if (!list->uniques || z == LY_ARRAY_SIZE(list->uniques)) {
+                        if (!list->uniques || z == LY_ARRAY_COUNT(list->uniques)) {
                             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                                    "Invalid deviation deleting \"unique\" property \"%s\" which does not match any of the target's property values.",
                                    d_del->uniques[x]);
                             goto cleanup;
                         }
                     }
-                    if (!LY_ARRAY_SIZE(list->uniques)) {
+                    if (!LY_ARRAY_COUNT(list->uniques)) {
                         LY_ARRAY_FREE(list->uniques);
                         list->uniques = NULL;
                     }
@@ -6112,7 +6112,7 @@
                                 }
                                 dflt = NULL;
                             }
-                            if (y == LY_ARRAY_SIZE(llist->dflts)) {
+                            if (y == LY_ARRAY_COUNT(llist->dflts)) {
                                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE, "Invalid deviation deleting \"default\" property \"%s\" "
                                        "which does not match any of the target's property values.", d_del->dflts[x]);
                                 goto cleanup;
@@ -6126,10 +6126,10 @@
                             llist->dflts[y]->realtype->plugin->free(ctx->ctx, llist->dflts[y]);
                             lysc_type_free(ctx->ctx, llist->dflts[y]->realtype);
                             free(llist->dflts[y]);
-                            memmove(&llist->dflts[y], &llist->dflts[y + 1], (LY_ARRAY_SIZE(llist->dflts) - y) * (sizeof *llist->dflts));
-                            memmove(&llist->dflts_mods[y], &llist->dflts_mods[y + 1], (LY_ARRAY_SIZE(llist->dflts_mods) - y) * (sizeof *llist->dflts_mods));
+                            memmove(&llist->dflts[y], &llist->dflts[y + 1], (LY_ARRAY_COUNT(llist->dflts) - y) * (sizeof *llist->dflts));
+                            memmove(&llist->dflts_mods[y], &llist->dflts_mods[y + 1], (LY_ARRAY_COUNT(llist->dflts_mods) - y) * (sizeof *llist->dflts_mods));
                         }
-                        if (!LY_ARRAY_SIZE(llist->dflts)) {
+                        if (!LY_ARRAY_COUNT(llist->dflts)) {
                             LY_ARRAY_FREE(llist->dflts_mods);
                             llist->dflts_mods = NULL;
                             LY_ARRAY_FREE(llist->dflts);
@@ -6671,7 +6671,7 @@
     struct lyxp_set tmp_set;
     struct lyxp_set_scnode *xp_scnode;
     uint32_t i, j;
-    LY_ARRAY_SIZE_TYPE u;
+    LY_ARRAY_COUNT_TYPE u;
     int idx;
     struct lysc_when *when;
     LY_ERR ret = LY_SUCCESS;
@@ -6760,7 +6760,7 @@
 {
     struct lyxp_set tmp_set;
     uint32_t i;
-    LY_ARRAY_SIZE_TYPE u;
+    LY_ARRAY_COUNT_TYPE u;
     int opts, input_done = 0;
     struct lysc_when **when = NULL;
     struct lysc_must *musts = NULL;
@@ -6899,7 +6899,7 @@
                                  lys_resolve_prefix, lref->path_context, LYD_SCHEMA, &p));
 
     /* get the target node */
-    target = p[LY_ARRAY_SIZE(p) - 1].node;
+    target = p[LY_ARRAY_COUNT(p) - 1].node;
     ly_path_free(node->module->ctx, p);
 
     if (!(target->nodetype & (LYS_LEAF | LYS_LEAFLIST))) {
@@ -6994,7 +6994,7 @@
     struct lysc_node *node;
     struct lysc_type *type, *typeiter;
     struct lysc_type_leafref *lref;
-    LY_ARRAY_SIZE_TYPE v;
+    LY_ARRAY_COUNT_TYPE v;
     uint32_t i;
 
     /* for leafref, we need 2 rounds - first detects circular chain by storing the first referred type (which
@@ -7072,7 +7072,7 @@
     struct lysp_augment **augments = NULL;
     struct lysp_grp *grps;
     struct lys_module *m;
-    LY_ARRAY_SIZE_TYPE u, v;
+    LY_ARRAY_COUNT_TYPE u, v;
     uint32_t i;
     LY_ERR ret = LY_SUCCESS;
 
