Improved error messaging