Fix error cases.
Add id to variants.