Cleaning up MDL error reporting and validation code.