Fixed bug in variant generation code.