Fixed some bugs in sender.c, added check for correct file size