Fix bug in CustomTrigWriter