Fixed the remaining Python 3 compatibility issues.
16 files changed