Fix Nearest(k-nn) query problems.