fixed a bug in pccc encoder/decoder, and added fsm files.
Also added locks in the set_ methods