Made the code compatible with python3 and current upstream/master