Fix a bug in example code, and doc typo, formatting fixes.