Fix indexing of sparse vectors in kmeans centers