Still tracking down generated code bug, adding tests.