Small changes

This should help and make sure the environment lasts in the following functions.