Updated replace to do global replace rather than first instance.