Lots of local cleanups.