Fix unit tests for environment.py