adjustments to last fix to make it pass on python 3