ENH: fixing bugs with new distance method