Important bugfix & generated code optimization.