Improved error handling...