typo fixes and castgenerator changed to cast