Fix env on teardown