Fixed bug -- inappropriate $this.
Thanks to Luke O'Sullivan for the catch.