Replaced *global* variable with $this->wg access