Added tests for protobuf messages.
Fixed bug in utilities.