Many clean-ups and minor improvements.