Fixed the addWrapFunction code so it now only adds one wrapFunction method per object.