fixed bug where values with exactly the same value in a KDTree would
trip up the nearest search