Merge "Change the CHECK failure into function failure." into oc-dev am: bf6e949727
am: 4847c7f708

Change-Id: Iea6c547dc36ab3910f4100d0dbf60a56201a0107