Fix the command output capturing so that failures are reported
correctly.