compat-fixes for python2.7/3.3