Improvements to diagnostics