fix all the problems with new Xperms2 hook, and update library to match.

Signed-off-by: Nick Minkler <sleaker@gmail.com>