Fixed endless loop in k-medoids, still very slow.