fixed bug in gen_init code