small changes for python3 port