Fixed grouping messages

Closes #293