New functions, fix bug with homedir