Fix event detection.