partial fixes for python2 to get this working again