Misc buffer fixes and documentation improvements from PR 1361.

s/operate on/query/.