Fix problems of CustomTrigWriter and others