Minor style fixes and lots of cleanup