fix several errors