Switch to mini-batch K-means, should be faster. And fix bugs.