lib: fix handling global enable flag