Fixing a bug in sparse_matrix

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>