Proper checking of env string.

Change-Id: Ia9b488d4c9c0fe4864c2b557fafaf7dacaba235e