Fixed some CHECKs in protobuf layer.