Fixed typo and 'this' references

* Fixed a typo in the addExtensions method causing an undefined error
* Fixed a scope 'this' issue by storing the formatter in a 'self'
variable