Minor CLI.upload optimizations and cleanup