Added references, fixed creation of messages with package/parent.