fix bug in sparse matrix parsing