Do a bunch of trivial cleanup.