Fix plugin code examples

addresses #310 plus other minor style issues