Updated diagnostics code