COSMIT skip some repeated computations in k-means
BUG fix whitespace in error messages

Partial fix for #2380.

Signed-off-by: Lars Buitinck <L.J.Buitinck@uva.nl>