Fixed IllegalArgumentException caused by bad generation