little PEP 8 + dict.keys changed according to Python 3

dict.keys was a list in Python2, but an iterator in Python 3. If you
want to get the 0th element, you have to convert it to a list.