Minor improvement to code and log comment.