Fix unclosed hooks