Correct some PluginManager bugs ; Need to correct cast error