Invalid use of $this within closures.

It's a small thing but it made it impossible to deploy to appfog.