Server checks for EOF from client; fix #1