Error handling improvements.