Fixed copy clustering function.