Fix tests with an environment