Fix some Python 3 issues.