py3: fix dist_keys indexing