Fix NumberGenerator, some cleaneup