Fix "Using $this when not in object context" in 5.3