# Buggy code
def __init__(self, index, sort=False, processed=False):
    self.index = index
    if not processed:
        for fkey, info in iteritems(index.copy()):
            for fstr in chain(
                info.get("features", "").split(),
                info.get("track_features", "").split(),
                track_features or (),
            ):
                self.add_feature(fstr, group=False)
            for fstr in iterkeys(info.get("with_features_depends", {})):
                index["%s[%s]" % (fkey, fstr)] = info
                self.add_feature(fstr, group=False)

    groups = {}
    trackers = {}
    installed = set()
    for fkey, info in iteritems(index):
        groups.setdefault(info["name"], []).append(fkey)
        for feat in info.get("track_features", "").split():
            trackers.setdefault(feat, []).append(fkey)
        if "link" in info:
            installed.add(fkey)

    self.groups = groups
    self.installed = installed
    self.trackers = trackers
    self.find_matches_ = {}
    self.ms_depends_ = {}

    if sort:
        for name, group in iteritems(groups):
            groups[name] = sorted(group, key=self.version_key, reverse=True)


# Traceback (KeyError)
$ conda update conda-build
...
Traceback (most recent call last):
File "/Users/ilan/python/bin/conda", line 6, in <module>
sys.exit(conda.cli.main())
File "/Users/ilan/conda/conda/cli/main.py", line 120, in main
args_func(args, p)
File "/Users/ilan/conda/conda/cli/main.py", line 127, in args_func
args.func(args, p)
File "/Users/ilan/conda/conda/cli/main_update.py", line 64, in execute
install.install(args, parser, 'update')
File "/Users/ilan/conda/conda/cli/install.py", line 381, in install
plan.display_actions(actions, index, show_channel_urls=args.show_channel_urls)
File "/Users/ilan/conda/conda/plan.py", line 66, in display_actions
info = index[dist + '.tar.bz2']
KeyError: u'anaconda-2.4.0-np110py27_0.tar.bz2[m.tar.bz2'

# Fixed code
def __init__(self, index, sort=False, processed=False):
    self.index = index
    if not processed:
        for fkey, info in iteritems(index.copy()):
            if fkey.endswith("]"):
                continue
            for fstr in chain(
                info.get("features", "").split(),
                info.get("track_features", "").split(),
                track_features or (),
            ):
                self.add_feature(fstr, group=False)
            for fstr in iterkeys(info.get("with_features_depends", {})):
                index["%s[%s]" % (fkey, fstr)] = info
                self.add_feature(fstr, group=False)

    groups = {}
    trackers = {}
    installed = set()
    for fkey, info in iteritems(index):
        groups.setdefault(info["name"], []).append(fkey)
        for feat in info.get("track_features", "").split():
            trackers.setdefault(feat, []).append(fkey)
        if "link" in info:
            installed.add(fkey)

    self.groups = groups
    self.installed = installed
    self.trackers = trackers
    self.find_matches_ = {}
    self.ms_depends_ = {}

    if sort:
        for name, group in iteritems(groups):
            groups[name] = sorted(group, key=self.version_key, reverse=True)