Fix k-means clustering.