Minor fix in exception handling.