Fix PHP error and plugin uninstall hook