Some basic error handling.