fixed comparison bug, and made Receiver close InputStream when done.