Fixed a couple of python2.6 2.7 incompatibilities