Be more resiliant against env variables not being set
getenv can return null so don't crash (constructing a std::string from null is not good) if that happens
getenv can return null so don't crash (constructing a std::string from null is not good) if that happens