More error handling for protobuf layer.