More error handling improvements.