Most of the proto unit tests done.
Also, fixes to proto.