Search code fixes