Fixed some leftover incompatabilities for python3 from python2