Merge "Made cleanupUploadStash use batching for the last two loops"