Fix root detection