Minor adjustments to exceptions and thread constants.