Kesem(#21): fixed a bug
Fixed the bug when the entire matrix is zero.