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