Added new test for empty env. Fix null host.