Fix panic when `ENV ARG=ARG` is used.

Closes #7813