Fixed warning when registering hook.