Added some error handling to jhasy.Env