Fixed potential bug in env_spec