Specify strings as bytes for str.replace.

Otherwise, Python 3 will error with the following message.

TypeError: expected bytes, bytearray or buffer compatible object