Fix some rudimentary errors in k_means.