Python 3.3 fixes

Tox still doesn't run successfully for me, but this fixes a fair few errors.