Fixed bug in MockEnvironment