Also fix some setup hooks that unnecessarily used environment hooks, which revolted in the same variable being modified too many times.