Fix illegal access to $this in static context.