Fixed: prevent looping indefinitely when stderr is EOF