Improved error handling and message display.