Fix some errors with Python2.6 and Python3 in PR #23

Not sure if I'm helping, but I fixed (or did I not?) some errors that were failing @alvinchow86's awesome ['refresh token feature' pull request](#23)

Any feedback will be greatly appreciated.