Update messages.c

Sync'd with mdhim-tng