Fix immediate capture bug.
Correct command and env.