Some fixes to make inner class generator work.