TNS-22: Change some str/replace calls so they work on Windows

Signed-off-by: Stuart Sierra <mail@stuartsierra.com>