Fixed tests, added message-id generation