correct some glitches in python3