More fixes in save_file. It wasn't actually saving the payload received into a file with the fname as it was supposed to. It instead wrote into the socket buffer....