Fix Struct/Tree id generation + tests