py3 fixes - compatible with py2