Fixed some Python 3 bug.