A few tweaks for Python 3

The tests are still crashing for me with a segfault, but you gotta start somewhere... :-)