This doesn't seem to be related to hooks; can you pull this out into a separate pull request/bug please? :)