Fixed the loops so they don't fail infinitely when they encounter a chip they can't program