Updated to the new AddHook() API.