Clean up the error handling.