Merge Patrick's exception branch.