Added some workarounds for the use of str_replace