docs cleanup

Fix bugs in the example code, typos etc.
Merge pull request #209 from jcerjak/master

Documentation cleanup