Further error handling improvements.