Added handling of cancelled messages.

Also, added code links to the header.