Added a lot of debug printouts to upload.