Merge "Change the CHECK failure into function failure." into oc-dev