Fixed event_id check; added comments.