Fix: NPE in EnvironmentAgent