Fix for handling set_environment when installing tool dependencies along with a tool shed repository.
Merged from next-stable