make env parsing a little more robust