Fix triplet search bug