Less buggy env var handling (I hope)