Correctly exit on errors.