More cautious escaping of environment values.