Make uisoure optional, add cleanEnvironment option. Fixes #4398
Merge pull request #4403 from mmascher/SLC6_fixes

Make uisoure optional, add cleanEnvironment option. Fixes #4398