Added a fix to ensure that data, indices and indptr are always the same length.