Fix AutoPlugins declared at top-level

Fixes exception occuring when loading auto plugins, which are declared
as top-level classes
Merge pull request #1423 from lpiepiora/fix-top-level-auto-plugins

Fix AutoPlugins declared at top-level