Fix py2 and py3