fix bad substitution of $HOME for '~'