Fixed path root checking in findroot()