Fix the bugs introduced when moving configuration to envvars