Improved error messaging.