Fix the env-has-content function