Added logging of cause of xupload_file 404 error and other improvements