Improved error reporting and test handling.