Merge "Add typecheck C++ API test to verify proper behavior." into klp-dev