PluginInit and hook fixes