Updated for 2.2 to avoid reliance on $this->data which is gone now.