Small modifications to plugin loading