Fixing a bug with the new diagnostics code.