Improved error message extraction.