Fix Python3 errors.

Works for Python3 now.