Fix typos and make code example valid Python
Merge pull request #1415 from merwok/patch-2

Fix typos and make code example valid Python