fixing tiny bugs
Merge pull request #77 from square/py/gen_fix_bugs

fixing tiny bugs