Various minor improvements to code and comments.