Limit search distance properly