fixing up a bunch of errors