Infinite loop avoidance in Unexpected EOF

#15