Fixed string conversion bug in Python 2.