Replacing ~ with $HOME to fix compatibility on old versions.