Better handle EOF