Fix bunch of py3 issues.