Added checks for PEX and GM permission changes.
Fixed plugin hooks.