Fix DISABLE_EVENTS build