From Designer fixes

Code gen and fixes for Lazarus 1.0.4