Fixes for python2