Tweaks to the generator

There is another error showing up with (!!) out of range that should be
checked.