A further fix for getEnvironment().