Also fix some setup hooks that unnecessarily used environment hooks, which revolted in the same variable being modified too many times.
This reflects upstream versioning change, and allows us to replace 4.0 with 4.1 (which is now a minor revision) without changing the attribute name. Thanks to @vcunat for the idea.