Fixed a bytes/str issue for Python 3.