Tidy up top level exception handling.