Merge "Add safety checks on KEY_INTENT mismatch." into tm-dev