Modified exception handling.