fixed a bunch of small errors