NumPy compatibility changes: only construct sparse matrices with 2D shape -- make nnz a separate kwarg