Fix bug in HASH_REPLACE_STR.

HASH_REPLACE_STR does not work properly without this change.