schema tree BUGFIX always set features of a module
diff --git a/src/tree_schema.c b/src/tree_schema.c
index 9089a3c..e6239da 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -800,12 +800,6 @@
 
     assert(!mod->implemented);
 
-    if (mod->ctx->flags & LY_CTX_EXPLICIT_COMPILE) {
-        /* do not compile the module yet */
-        mod->to_compile = 1;
-        return LY_SUCCESS;
-    }
-
     /* we have module from the current context */
     m = ly_ctx_get_module_implemented(mod->ctx, mod->name);
     if (m) {
@@ -820,6 +814,12 @@
     /* enable features */
     LY_CHECK_RET(lys_enable_features(mod->parsed, features));
 
+    if (mod->ctx->flags & LY_CTX_EXPLICIT_COMPILE) {
+        /* do not compile the module yet */
+        mod->to_compile = 1;
+        return LY_SUCCESS;
+    }
+
     /* add the module into newly implemented module set */
     LY_CHECK_RET(ly_set_add(&unres->implementing, mod, 1, NULL));