Various tidy-ups and improvements.