Fix replying to diary comments, and tidy a few things up.