Normalize code examples, clarify and fix typos in the documentation

Just some documentation fixes.