added tests to environment, fixed minor bugs