Added diag code.