Restored implementation for auto register hooks.