Fix automatic discovery of message factories