Fix documentation example code

See http://stackoverflow.com/a/26759417/13860
Fix another instance
Better handling of 'client' in disposer function
Merge pull request #377 from flimzy/docs

Fix documentation example code