Changed the variable replacer.

* Replaced the string.Replace with string.gsub, should be more reliable and faster.