Fix fatal error when removing hooks

Signed-off-by: margarett <bruno.m.alves@gmail.com>
Merge pull request #13 from margarett/master

Fix fatal error when removing hooks