Try-catch added around registry functions in the event of an unhandled exception.