Improve env validation