Correct error-handling with non-CSR/CSC sparse matrices.