Clean up error handling