Fix traceback when there is only one target for pkg.latest
Merge pull request #5898 from terminalmage/quickfix

Fix traceback when there is only one target for pkg.latest