Fix typos and improve consistency

Besides fixing a few typos, use ellipses a bit more consistenly
in code snippets.