Added loop breaks to searches to increase performance.