Fix two Python 3 incompatibilities (fixes #3)