Some improvements

* avoid using ().* in select to avoid multiple evaluations of a function

* Throw an error when number of cluster is smaller than 2