Fixed whitespace:  tabs to spaces.
Fixed logic in lattice.generate .