String prototype functions do not properly recieve "this" keyword

When using "this" inside of a custom string prototype function (i.e String.replace = function(i, i2, str) return this.substring(0, i) + str + this.substring(i2, this.length-1) end), instead of returning the current string, it returns the global "this" (aka the whole microscript object). List and Objext, on the other hand, works properly and returns the current list, whereas Number has the same problem as string.