2 Python3 fixes

which should also work in Python2. I'm not a python developer though. :) This also fixes issue #31