Bug fixes for local upload to remote