Fix segv when $HOME is not defined