Fix compiler warning in init2.c
Fix compiler warning in generate.c
Clean up ui.c/h