Improve diagnostics