Merge "Fix an incorrect CHECK in the code." into pi-dev