Changes to DynamicEnvironment, and tests for it, to not violate Liskov