Add better handling of $HOME.