Python 3 compatibility fixes
Merge pull request #51 from jhamrick/python3

Python 3 compatibility fixes