Only add root environment variables if necessary