Fixed invalid metadata and updated weak references on PluginManager