Fix some errors related to Python3.