Fixed calling of external hooks.