Fix reducing to not change the order of objects/attributes