fix comparison in search_nn_dist(), fixes #8