Fixed "find nearest" bug