Slight modifications to allow running on python 3
Merge pull request #229 from brutasse/fix/py3

Slight modifications to allow running on python 3