Restored code fixes destroyed by GUI update below.

Must watch diffs when doing new code generation!