Corrected detection of TestResult Failures/Errors for xml writing