Packet Integrity: add comment and fix bug.

The function is supposed to return the trimmed message.