K-Means bug fixes