Reverting the setupenv stuff, as it needs to be done more carefully.