EOF inside the loop. Also fix another unbounded loop that did not check for EOF. From Mateusz Kocielski XXX: pullup-7