Fix a bug in Hooks.

Maybe some day I will move this out of Hooks.