bug fix in PackageSorterNearest