Cleaning up the exception handling.