fix several small errors