Typing mistakes fixed

Double checked the code (but didn't tested it) and found that the
plain hook we are adding with PL didn't match with the add_hook
statement. Now it should be ok.