Bug fix: diag to cpt