Fixes to the error catching. (v3.6.7)