Fixed bug when removing representatives after the knn extension