Fix incompatibility issue with Python 3.