Use a more deterministic (bug uglier) way of determining homedir