Fix a model bug and add a test case for BeaconTraitTypeInstruction