minor fixes to main_init