Solve KDtree bug!