Minor fix to exception handling.