Fixed str_replace procedure

Signed-off-by: Mikhail Grigorev <sleuthhound@gmail.com>