Fix error complaining about null bytes in string

Error was "TypeError: must be encoded string without NULL bytes, not str"

Unicode seems to have been the cause.