Fix error in root path detection