refactorings suggested by ShellChecker, quotings, etc.
fixed kindle-rsync