Lots of small cleanups