Fix some Python 3 errors.