Needs a little more finesse to handle non-zero exits.