Fixed a bug

Bug Description: fail to generate correct combination when duplicated
color is not allowed.