fixes to KMeansw