Python 3 support. Fixes #115