replace missing this.
fix misc bugs