Fixed a bug when the matrix C is all zero.