Fix bug in pre-existing-variant check