fixed bug in sparse matrix parsing