Fixed a bug with the internal replace methods.

Signed-off-by: Jared Woolston <jwoolston@tenkiv.com>