Update the error management system to work better with PHPUnit tests.