fix up a bunch of stuff