Fix device indexing for python3
Merge pull request #16 from etataurov/py3keysindexing

Devices indexing doesn't work on python3