LegacyHooks: add missing @Deprecated annotation
LegacyHooks: fix warning

The loader variable cannot be null.