Add threshold to ignore pairs with few points (this avoid segfault, but something else should be done)