minor corrections in exceptions handling