Misc buffer fixes and documentation improvements from PR 1361.