Fix non-unique message ID problem

Fixes issue #52