Added support of diag(k)