fix diag