Clean up error handling.