Overwriting $this when using references