Fix SyntheticEvent.persist being removed during advanced compilation