add python3 fixes/workarounds