Revised exception handling.