Fix crash when redefine class.