fixed errors at end of download/upload.  Added command line with error handling.  Made seed mode and leech mode independent.