Fix bytes/string error in Python 3