Updated to deal with having no home directory gracefully and fixed bug introduced with childcount patch