Additional fixes needed for py3k

@mlafeldt @gabrielfalcao Sorry that the original pull request for this didn't catch everything. I had messed up the tox.ini so I missed a bunch of issues. I feel much better this time.

Mathias, would you mind giving this branch a try if you get a few minutes?