Remove unused messages.