Fix env checks