Fix bug with plugin loading

Introduced by recent refactoring