Minor fix of the special case when executing from shell/contrived environment.

Change-Id: I291247bc54f302c1270b6700f1da0b358f451a2f
Merge "Minor fix of the special case when executing from shell/contrived environment."