Various tidy-ups and simplifications.