For #27328 - Improved fix for hook sub-classing