oops: Fix bug where $this object is used out of context.