Initial commit: merged diagnostics and counters