python 3.x fixes