Small refactoring in remote.cc
Tweak completer scripts