Replaced ~ with $HOME everywhere.