Python 3 bug fix

TypeError: 'dict_items' object does not support indexing