Clean up error handling and recovery.