First of all, prior to a high-level visit we would be consulting with a broad range of partners. We'd also be looking at our records of previous visits made either by that individual or by the person holding the office the individual represents. We would be consulting with our mission in that country. We would be looking at what sort of treatment would best serve Canada's interests in terms of making proposals for a program that would be of interest to the guest. For example, if it would mean travel to other cities within Canada, we would consult with the relevant provinces or municipal offices of protocol. We would consult on the program with colleagues across town, working very hard throughout the visit to make sure it was a true expression of Canada's respect for the guest, that it would be honouring the visitor, and operating mightily to avoid the kinds of slip-ups you referred to, while recognizing that sometimes last-minute changes are necessary.
After each major visit we have an internal review to discuss what worked well, what we should be doing to maximize felicitous results, and what didn't work so well and needs even more careful scrutiny and attention next time.
So, yes, we do try to learn from the past.