Fixing Linear generator, unit tests.