Fix typo in message hook.
Tidy up a bit.