Fixed Python 3 issues.