Fix handling of eof in login