python2.7 fixes