fixed getNearestPoints()