Fix default env value problems when using as a library