fixed copy SaveStruct from union,and some NULL pointer errors.