Changes for Python3 support