Fix calling hooks for the QUIT event.