Use "set -e", drop "exit 1" where it's now redundant.