Fixed errors in code generator and data structure.