Fix issue with replace.
Merge pull request #6 from mattyod/feature/fix-replace

Fix issue with replace.