Fixes for python2.7