Added extra sanity checks to home directory searching.