fix a few bugs in the example plugin