Change Environment class interface
Fix test case