Fix errors introduced in refactor (script needs UT)
Misc. env updates