fix easy py3 syntax
fix error reporting
py3 dict has items instead of iteritems
Merge pull request #48 from mgax/py3

Py3