improve support for indexing in dicts and tuples