Fix errors outline in Issue #1

Fixes a few notices, warnings and a fatal with activated example plugin. Errors outline in #1