Fix hook registration