Fix NULL pointer dereference for stdin commands.