Fix bug in search factors