Changed the byte-to-string conversion to make it work with both python3 and python2.