Added some proto marshalling code