Fix bug with hooking in plugin.php