Use explicit error codes for exit calls

Probably best not to rely on bash to carry the exit value forward
correctly; clearer this way anyway