Fix generating messages with enum or flag properties