Fix bug in earlier TestEnvironment refactoring.