Changed knn_complex api a little bit.