Fix root detection.