KRACOEUS-7847 and KRACOEUS-7282

Please review this PR, some more work pending, don't merge it just yet.
I really dont understand this block of code where you are setting the ProposalStateTypeCode(pCode) since it is just being set to what it already is.