Use $HOME before anything else to determine the home directory. Patch by Benjamin...