Code updated according to latest protobuf changes.