Add basic error handling.