Improvements on exception registration.