fix an issue in kmeans and also one in mvn2