Added fix for infinite loop when socket is EOF