Rewritten _collect_tags() to use the master index.