fix substring replacement
Merge pull request #2 from evindor/master

Fix string replacement.