Fixed incorrect string replace

I haven't done Python in a while so I may be missing something. So far as I can tell this never worked properly as the syntax was slightly incorrect.