Fix hook unit tests