Mostly plugin bug fixes introduced with the last pull.

Fixes #77